Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

303
Vistas
Form Error Messages Are Not Displayed Laravel 5

I'm new at Laravel and I want to Use the authentification system included in Laravel. To do so I activated authentification in my laravel projet with

php artisant make:auth

Then I tryed to log in in the my projet and everthing works but the error messages like "e-mail field is required" aren't shown when I submit the empty form.

Here is an example of the error test auto implemented in my login.blade.php :

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
          <div class="col-md-12">
              <input id="email" type="email" class="form-control" placeholder="{{ trans('validation.attributes.email') }}" name="email" value="{{ old('email') }}" required autofocus>

              @if ($errors->has('email'))
                  <span class="help-block">
                      <strong>{{ $errors->first('email') }}</strong>
                  </span>
              @endif
          </div>
</div>

Please notice that when I enter a bad combinaison of email/password the error message is shown correctly but for any other case the page doesn't even refresh.

Thank you for your help ...

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You input email field is required. Your browser probably does not submit the request because of this. If you remove the "require" attribute from your email input, the error should be shown.

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
      <div class="col-md-12">
          <input id="email" type="email" class="form-control" placeholder="{{ trans('validation.attributes.email') }}" name="email" value="{{ old('email') }}" autofocus>

          @if ($errors->has('email'))
              <span class="help-block">
                  <strong>{{ $errors->first('email') }}</strong>
              </span>
          @endif
      </div>

Also, you can use this code to show "all" errors when they occur:

@if (count($errors) > 0)
    <div class="alert alert-danger">
        <strong>Whoops!</strong><br><br>
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda