[Solved] Laravel check if user exists


User with the same name, surname, and birthday

$duplicate_user = \DB::table('users')
    ->where('name', 'LIKE', $new_name)
    ->where('surname', 'LIKE', $new_surname)
    ->where('birthday', '=', $new_birthday)
    ->first();

if($duplicate_user) {
    return response('This user already exists', 422);
}

solved Laravel check if user exists