Answers for "laravel validation from a certain table"

PHP
0

laravel validation if data exists

'user_id' => 'required|exists:App\Models\Users,id'
Posted by: Guest on September-29-2021
0

laravel validation exists multiple tables laravel

$validator = Validator::make($request->all(), [
    'title' => [
        'required',
        'max:255',
        function($attribute, $value, $fail) {
            if ($value === 'foo') {
                return $fail($attribute.' is invalid.');
            }
        },
    ],
]);
Posted by: Guest on November-26-2021

Code answers related to "laravel validation from a certain table"

Browse Popular Code Answers by Language