We can change in the resources/lang/en.php the default login error message:
<?php
return [
'failed' => 'These credentials do not match our records.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
];
But in the login form, if the user insert an invalid email, or dont fill the email field and password, or any other case that should result in an error the message is always the same: 'These credentials do not match our records.'
Do you know how to have different custom messages for different error cases? Like if the email field is required and was not filled, the email dont have an invalid format or the email is not registered in the system?
For example have rules like:
$rules = [
'email' => 'required|email|exists:users.email'
];
$customMessages = [
'email.required' => 'The email field is mandatory.',
'email.email' => 'Introduced email doesnt have a valid format.',
'email.exists' => 'Introduced email is not registered in the system.',
];
$this->validate($request, $rules, $customMessages);