How to customize login error messages in Fortify Laravel 8

Viewed 3998

When users enter wrong username or password they get the following message:

These credentials do not match our records.

How can I change this message to something like:

You have entered an invalid username/password or both. Please try again.

I know that I can change the message by editing the following file:

App/resources/lang/en/auth.php

My question is there a better way like a function for example where I can customize how data is validated?

Actually I'm looking for something like App/Actions/Fortify/CreateNewUser.php file that's generated after executing the following command:

php artisan vendor:publish --provider="Laravel\Fortify\FortifyServiceProvider"

Inside this file there's a function named create($input) that I can easily manipulate to validate data entered by the users before storing it in the database.

0 Answers
Related