title: Looping through validation errors in view
body: <p>I'm using Laravel's form validation functionality and trying to work out how I can loop through the form errors in my view. At the moment, I'm successfully validating the form using the below code:</p>
  
  <pre><code>public function create()
  {
      $validator = Validator::make(
          Input::all(),
          array(
              'username' =&gt; 'required|alpha_num|unique:users',
              'email' =&gt; 'email|unique:users',
              'password' =&gt; 'required|min:6',
              'passwordConf' =&gt; 'required|same:password'
          )
      );
  
      if ($validator-&gt;fails())
      {
          return Redirect::to('join')-&gt;withErrors($validator);
      }
  
      return View::make('user/join')-&gt;with();
  }
  </code></pre>
  
  <p>The validator successfully validates the form and redirects to the <code>join</code> route if validation fails. Obviously, I'd also like to show the validation messages to the user. I have a <code>master.blade.php</code> layout file which all of my views extend, and in the layout I have the following code:</p>
  
  <pre><code>@if (Session::has('errors'))
      &lt;div class="alert alert-danger"&gt;
          @foreach (Session::get('errors') as $error)
              Test&lt;br /&gt;
          @endforeach
      &lt;/div&gt;
  @endif
  </code></pre>
  
  <p>This seems to half work. If there are validation errors, the alert div does show on the page, however no validation errors get output. That suggests that <code>Session::has('errors')</code> is returning true however I'm obviously not iterating through the validation errors correctly.</p>
  
  <p>How do I iterate through the validation errors sent to the view via <code>withErrors</code>?</p>