Answers for "rules exists laravel"

PHP
3

laravel exists validation

'state_id' => 'exists:states,id'
Posted by: Guest on January-18-2021
0

laravel custom exists rule

Validator::make($data, [
    'email' => [
        'required',
        Rule::exists('staff')->where(function ($query) {
            return $query->where('account_id', 1);
        }),
    ],
]);
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language