title: Laravel 5 validation errors are not showing
body: <p>I am learning <code>Laravel 5</code> and I have wrote following code for user login. Now I am trying display validation errors messages with this code:</p>
  
  <pre><code>@if(count($errors))
      &lt;div class="alert alert-danger"&gt;
          &lt;ul&gt;
              @foreach($errors-&gt;all() as $error)
                  &lt;li&gt;{{ $error }}&lt;/li&gt;
              @endforeach
          &lt;/ul&gt;
      &lt;/div&gt;
  @endif
  </code></pre>
  
  <p>but nothing is displaying. :(</p>
  
  <p>Any idea whyerrors are not displaying, If user not enter any value and hit submit button.</p>
  
  <p>Thanks.</p>
  
  <h2>routes.php</h2>
  
  <pre><code>Route::get('/', function () {
      return view('welcome');
  });
  
  Route::group(['middleware' =&gt; ['web']], function () {
      Route::get('/login', ['as' =&gt; 'login', 'uses' =&gt; 'AuthController@login']);
      Route::post('/handleLogin', ['as' =&gt; 'handleLogin', 'uses' =&gt; 'AuthController@handleLogin']);
      Route::get('/home', ['middleware' =&gt; 'auth', 'as' =&gt; 'home', 'uses' =&gt; 'UserController@home']);
      Route::get('/logout', ['as' =&gt; 'logout', 'uses' =&gt; 'AuthController@logout']);
      Route::resource('user', 'UserController', ['only' =&gt; ['create', 'store']]);
  });
  </code></pre>
  
  <h2>login.blade.php</h2>
  
  <pre><code>@extends('layouts.master')
  
  @section('content')
  
  &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
          &lt;h2&gt;Log in&lt;/h2&gt;
          &lt;p&gt;Hi, here you can login to your account.&lt;/p&gt;
          &lt;br&gt;
          @if(count($errors))
              &lt;div class="alert alert-danger"&gt;
                  &lt;ul&gt;
                      @foreach($errors-&gt;all() as $error)
                          &lt;li&gt;{{ $error }}&lt;/li&gt;
                      @endforeach
                  &lt;/ul&gt;
              &lt;/div&gt;
          @endif
  
          {!! Form::open(array('route' =&gt; 'handleLogin')) !!}
              &lt;div class="form-group"&gt;
                  {!! Form::label('email', 'E-Mail Address') !!}
                  {!! Form::text('email', null, array('class' =&gt; 'form-control','placeholder' =&gt; 'example@gmail.com')) !!}
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  {!! Form::label('password', 'Password') !!}
                  {!! Form::password('password', array('class' =&gt; 'form-control')) !!}
              &lt;/div&gt;
  
              &lt;div&gt;
                  {!! Form::token() !!}
                  {!! Form::submit('Sign In' , array('class' =&gt; 'btn btn-primary')) !!}
              &lt;/div&gt;
          {!! Form::close() !!}
          &lt;br&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  @endsection
  </code></pre>
  
  <h2>AuthController.php</h2>
  
  <p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  use App\Http\Requests;
  use App\Http\Controllers\Controller;
  use App\User;
  
  class AuthController extends Controller
  {
      public function login()
      {
          return view('auth.login');
      }
  
      public function handleLogin(Request $request)
      {
          $this-&gt;validate($request, User::$login_validation_rules);
          $data = $request-&gt;only('email', 'password');
          if(\Auth::attempt($data)) {
              return redirect()-&gt;intended('home');
          }
  
          return back()-&gt;withInput();
      }
  
      public function logout()
      {
          \Auth::logout();
          return redirect()-&gt;route('login');
      }
  }
  </code></pre>
  
  <h2>User.php</h2>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      public static $login_validation_rules = [
          'email' =&gt; 'required|email|exists:users',
          'password' =&gt; 'required'
      ];
  }
  </code></pre>