Validate Form with array of rules.
Basically, I have a concrete class (SummerchildCareForm: https://codeshare.io/axgzWd) which build the schema or form fields with nested layout. This concrete class extends the base/abstract class which contains the traits and little common logic. For now I have only one SummerChildCareForm class which has a method getSchema, and also a static method "public static function validationRules(): array {return ['first_name' =>['required'...]...];}".
I am rendering this form on the frontend side with Livewire, https://codeshare.io/2p7zbx
The form get renders and when i hit the save changes button I even get the result but the validation doesn't work...
I wanted to ask is there possibility to pass validation rules array to the form directly instead writing rules for in each field?
Filamentphp v4 with Laravel v12.24
1 Reply
This is how seems to be resolved or a work around :(.
Submit method