title: laravel passing errors to views through controllers
body: <p>I am trying to validate in an action within my controller. once it fails, I send the messages resulting from the validator to the other function in the same controller to pass it to the view. The only problem is I don't see anything displaying in the view and the url changes to a weird format once I click submit and errors occurs. </p>
  
  <p>Controller:</p>
  
  <pre><code>&lt;?php
  
  class MembersController extends BaseController {
  
      protected $layout = 'layouts.master';
  
  
      public function loadRegisterView($input = null)
      {
          if($input == null)
              return View::make('members.register');
          else
              return View::make('members.register', $input);
      }
  
      public function loadLoginView()
      {
          return View::make('members.login');
      }
  
  
      public function register()
      {
  
          $rules = array(
              'first_name' =&gt; 'Required|Min:3|Max:88|Alpha',
              'last_name' =&gt; 'Required|Min:3|Max:88|Alpha',
              'password' =&gt; 'Required|Min:3|Max:88|Alpha|Confirmed',
              'email' =&gt; 'Required|email|unique:users',
          );
  
          $validator = Validator::make(Input::all(), $rules);
  
  
          if ($validator-&gt;fails())
          {
              $messages = $validator-&gt;messages();
              return Redirect::action('MembersController@loadRegisterView', $messages);
          }else{
              return "Thank you!";
          }
  
      }
  }
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>Route::get('login', array('as' =&gt; 'login', 'uses' =&gt; 'MembersController@loadLoginView'));
  
  Route::get('signup', array('as' =&gt; 'signup', 'uses' =&gt; 'MembersController@loadRegisterView'));
  
  
  Route::get('/', 'MainController@index');
  
  
  Route::post('processRegistration', array('as' =&gt; 'processRegistration', 'uses' =&gt; 'MembersController@register'));
  </code></pre>
  
  <p>in the View:</p>
  
  <pre><code>@if ( $errors-&gt;count() &gt; 0 )
        &lt;p&gt;The following errors have occurred:&lt;/p&gt;
  
        &lt;ul&gt;
          @foreach( $errors-&gt;all() as $message )
            &lt;li&gt;{{ $message }}&lt;/li&gt;
          @endforeach
        &lt;/ul&gt;
      @endif
  </code></pre>
  
  <p>and the URL looks like: </p>
  
  <pre><code>http://localhost:8888/store/index.php/signup?%00%2A%00messages%5Bfirst_name%5D%5B0%5D=The+first+name+field+is+required.&amp;%00%2A%00messages%5Blast_name%5D%5B0%5D=The+last+name+field+is+required.&amp;%00%2A%00messages%5Bpassword%5D%5B0%5D=The+password+field+is+required.&amp;%00%2A%00messages%5Bemail%5D%5B0%5D=The+email+field+is+required.&amp;%00%2A%00format=%3Amessage
  </code></pre>
  
  <p>Thanks in advance </p>