You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serverfire edited this page Dec 26, 2018
·
1 revision
CRUD Field Validation
In order to add a validation rule to each field in CRUD, you just need to call the 'rule' function by passing the validation rule, for example :
$this->edit->add('title', 'Title', 'text')->rule('required'); // A required field$this->edit->add('user_id', 'User ID', 'text')->rule('exists:users,id'); // The value of this field should exist in users table (id column)