exists id in the table in laravel validation 1

exists id in the table in laravel validation

'game_id' => 'required|exists:games,id,another_column,NULL',

Here is what the above code is Doing:
1. The first rule is saying that the game_id field is required.
2. The second rule is saying that the game_id field must exist in the games table.
3. The third rule is saying that the game_id field must exist in the games table and the another_column field must be NULL.

Similar Posts