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
To optimise the validation of list of values through the DB table, we need to implement custom validation rule.
How it should works:
publicfunctionrules(): array
{
return [
//will make `whereIn` query to determine which of values are not exists in DB'ids' => 'array|list_exists:users,id',
'ids.*' => 'integer',
//will works the same as in previous example but will find record in the `clients` table in `user_id` field and pluck `id` field from the input collection'users' => 'array|list_exists:clients,user_id,id',
'users.id' => 'integer'
];
}
The text was updated successfully, but these errors were encountered:
To optimise the validation of list of values through the DB table, we need to implement custom validation rule.
How it should works:
The text was updated successfully, but these errors were encountered: