Custom packages in Laravel can have validation rules, which are called via a class. This does not currently work in the Form builder.
E.g. in app/Forms/BookRequestForm.php
->add('isbn', TextType::class, [
'label' => 'ISBN',
'rules' => ['required', new Isbn([13])]
])
This does work, which is only OK since a shortcode has been setup for this rule. This may not always exist in custom validation rules.
->add('isbn', TextType::class, [
'label' => 'ISBN',
'rules' => ['required', 'isbn:13']
])
See https://laravel.com/docs/13.x/validation#custom-validation-rules
Custom packages in Laravel can have validation rules, which are called via a class. This does not currently work in the Form builder.
E.g. in app/Forms/BookRequestForm.php
This does work, which is only OK since a shortcode has been setup for this rule. This may not always exist in custom validation rules.
See https://laravel.com/docs/13.x/validation#custom-validation-rules