Answers for "laravel validation exists in table"

PHP
1

laravel exists validation

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

laravel validation

/**
 * Store a new blog post.
 *
 * @param  Request  $request
 * @return Response
 */
public function store(Request $request)
{
    $validatedData = $request->validate([
        'title' => 'required|unique:posts|max:255',
        'body' => 'required',
    ]);

    // The blog post is valid...
}
Posted by: Guest on October-19-2020
0

laravel validation if data exists

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

validation rule if row exist laravel

//update request 
return [
	'username' => 'unique:users,username,' . $this->route('internalUser')->id . ',id',
];

//create request
return [
	'username' => 'unique:users'
];
Posted by: Guest on November-07-2020

Code answers related to "laravel validation exists in table"

Browse Popular Code Answers by Language