Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

laravel custom exists rule

Validator::make($data, [
    'email' => [
        'required',
        Rule::exists('staff')->where(function ($query) {
            return $query->where('account_id', 1);
        }),
    ],
]);
 
PREVIOUS NEXT
Tagged: #laravel #custom #exists #rule
ADD COMMENT
Topic
Name
4+4 =