Answers for "laravel validate exists in table"

PHP
1

laravel unique 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 June-03-2020
0

exists id in the table in laravel validation

'game_id' => 'required|exists:games,id,another_column,NULL',
Posted by: Guest on June-04-2021

Code answers related to "laravel validate exists in table"

Browse Popular Code Answers by Language