title: Keep modal open after validation redirect
body: <p>i am currently working on a project where the login/register is handled through modal boxes (so i click the login button and a nice modal reveals with a form in).</p>
  
  <p>Im using foundation 5's reveal modal to house my login form but when the form is submitted and theres a validation error the modal closes. The reason this is happening is because i am redirecting back to the route where the login form is and in that route a button needs to be clicked to fire the modal.</p>
  
  <p>What i was wondering is, is there something i can set so that modal stays open if there is a validation error or exception (account not found etc.) So if there is a validation error the modal stays open.</p>
  
  <p>looking for any type of solution. my code is shown below.</p>
  
  <p>Login function </p>
  
  <pre><code>    public function postLogin()
     {
  
      // Declare the rules for the form validation
      $rules = array(
          'email'    =&gt; 'required|email',
          'password' =&gt; 'required|between:3,32',
      );
  
      // Create a new validator instance from our validation rules
      $validator = Validator::make(Input::all(), $rules);
  
      // If validation fails, we'll exit the operation now.
      if ($validator-&gt;fails())
      {
          // Ooops.. something went wrong
          return Redirect::back()-&gt;withInput()-&gt;withErrors($validator);
      }
  
      try
      {
          // Try to log the user in
          Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
  
          // Get the page we were before
          $redirect = Session::get('loginRedirect', 'dashboard');
  
          // Unset the page we were before from the session
          Session::forget('loginRedirect');
  
          // Redirect to the users page
          return Redirect::to($redirect)-&gt;with('success', Lang::get('auth/message.signin.success'));
  
      }
  
      catch (Cartalyst\Sentry\Users\UserNotFoundException $e)
      {
          $this-&gt;messageBag-&gt;add('email', Lang::get('auth/message.account_not_found'));
      }
      catch (Cartalyst\Sentry\Users\UserNotActivatedException $e)
      {
          $this-&gt;messageBag-&gt;add('email', Lang::get('auth/message.account_not_activated'));
      }
      catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e)
      {
          $this-&gt;messageBag-&gt;add('email', Lang::get('auth/message.account_suspended'));
      }
      catch (Cartalyst\Sentry\Throttling\UserBannedException $e)
      {
          $this-&gt;messageBag-&gt;add('email', Lang::get('auth/message.account_banned'));
      }
  
      // Ooops.. something went wrong
      return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;messageBag);
  }
  </code></pre>
  
  <p>Login modal </p>
  
  <pre><code>&lt;div id="myModalLogin" class="reveal-modal small" data-reveal&gt;
  
  &lt;h2&gt;Login&lt;/h2&gt;
  
      &lt;form method="post" action="{{ route('login') }}"&gt;
  
  
      {{-- CSRF Token --}} 
      &lt;input type="hidden" name="_token" value="{{ csrf_token() }}" /&gt;
  
      {{-- Email --}} 
  
      &lt;label for="email"&gt; Email
          &lt;input type="text" name="email" id="email" value="{{ Input::old('email') }}" /&gt;
      &lt;/label&gt;
      {{ $errors-&gt;first('email', '&lt;label class="error"&gt;:message&lt;/label&gt;') }}
  
     {{-- Password --}}
  
      &lt;label for="password"&gt; Email
          &lt;input type="password" name="password" id="password" value=""/&gt;
      &lt;/label&gt;
      {{ $errors-&gt;first('password', '&lt;label class="error"&gt;:message&lt;/label&gt;') }}  
  
      {{-- Remember me --}} 
      &lt;input name="remember-me" value="1" id="remember-me" type="checkbox"&gt;&lt;label for="remember-me"&gt;Remember me&lt;/label&gt;
  
      &lt;hr&gt;
  
      {{-- Form Actions --}} 
      &lt;button type="submit" class="button"&gt;Sign in&lt;/button&gt;
      &lt;a href="{{ route('forgot-password') }}"&gt;I forgot my password&lt;/a&gt;        
      &lt;a class="close-reveal-modal"&gt;&amp;#215;&lt;/a&gt;
  
  &lt;/div&gt;
  </code></pre>