Skip to content

Validation

tanthammar edited this page Sep 4, 2020 · 1 revision

rules($rules)

Sets the Laravel validation rules to use for the field.

$rules

A string or array of Laravel validation rules.

Example using a string:

Field::make('Name')->input()->rules('required|min:2'),

Example using an array:

Field::make('City')->input()->rules(['required', Rule::in(['Toronto', 'New York']), new MyCustomRule]),

Clone this wiki locally