Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sama's avatar
Level 1

Confirmation email and errors messages Laravel 5.4

1-Hello everyone I am a beginner in laravel 5.4 and I use the default authentication of laravel to constriure my authentication system for my website but when I validate the fields the error message comes back as JSON file. how can i customize error messages with ajax if it gives good results?

{"name":["Le champ nom est obligatoire."],"email":["Le champ adresse e-mail est obligatoire."],"password":["Le champ mot de passe est obligatoire."]}

2-I add a registration validation email and I have built a html page that appears in the new registered email but the site logo is not displayed. I don't know how I can solve this problem?

And thank you in advance

0 likes
1 reply
skoobi's avatar

If your using the Form Request Validation you can use something like this::

/**
 * Get the error messages for the defined validation rules.
 *
 * @return array
 */
public function messages()
{
    return [
        'name.required' => 'Le champ nom est obligatoire.',
        'email.required'  => 'Le champ adresse e-mail est obligatoire.',
    ];
}

Im pretty sure theres something on the Tutorials about it too.

For the image try the full path or set the base_url in the template

Please or to participate in this conversation.