Skip to content

Commit f68602b

Browse files
Add method to get form fields with max length filter
1 parent 293bff7 commit f68602b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Concerns/Resources/InteractsWithSchemas.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ public function getResourceRequiredFormFields(): array
2929
->all();
3030
}
3131

32+
public function getResourceMaxLengthFormFields(): array
33+
{
34+
return collect($this->getResourceFormFields())
35+
->filter(fn (Field $field): bool => method_exists($field, 'getMaxLength') && $field->getMaxLength() !== null)
36+
->all();
37+
}
38+
3239
public function getResourceFormFieldKeys(): array
3340
{
3441
return collect($this->getResourceFormFields())

0 commit comments

Comments
 (0)