vendredi 27 septembre 2019

Modify unique attribute validation in Laravel

Trying to customize the error message for unique attribute. Tried changing my validation.php.

    'custom' => [
        'email' => [
            'unique:users' => 'Oops, email is taken. Please try again!'
        ]
    ],

and I call the validation in controller:

    request()->validate([
        'email' => 'unique:users',
        'password' => 'required|min:3',
    ]);

And I still get this:

The email has already been taken.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2lBt3yH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire