redirect with errors not working...

Posted 4 years ago by jpeterson579

I am doing a redirect on a form that exists on multiple pages. I want to return them back to the page they filled the form on when there are any errors. Its returning them back to the page just fine however its not returning the errors... Any ideas?

controller

 if($validator->fails()) {
        return Redirect::back()->withErrors($validator)->withInput();
    }

view

 @if(Session::has('error'))
        <script>
            $("#alertmodal").hide().slideDown();
              setTimeout(function(){
                  $("#alertmodal").slideUp();        
              }, 4000);
        </script>
        <div id="alertmsg" class="alert alert-dismissable alert-danger">
              <button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button> 
              <strong>Error</strong>: {{ Session::get('error') }}
          </div>
    @endif

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.