Answers for "laravel validate only if present"

PHP
3

laravel exists validation

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

Determining if input is present in Laravel

if ($request->has('name')) {
    //
}

// When given an array, the has method will determine if all of the specified values are present:

if ($request->has(['name', 'email'])) {
    //
}
Posted by: Guest on October-24-2021

Code answers related to "laravel validate only if present"

Browse Popular Code Answers by Language