[Laravel 5.2] – No errors in session after validation fails

 

[Laravel 5.2] – No errors in session after validation fails

[Laravel 5.2] – No errors in session after validation fails

Hello guys, ever wonder why you can get the session flash after validation fails?.. Yeah.. i feel you. I’ve experience that already since i clone the latest laravel 5.2 repository.

 


Normally, when i setup a validation in my controller i would just put something like this:

or like this

And then in my blade, i’ll put something like this to show the errors in my page.

And the last part is to enable the middleware to add “web” in my Routes.

 

Before this part will suffice.. And then suddenly when i tried it, its not working already. After doing some searching and testing. I noticed that when i check the $validation->errors() it returns
the message bag objects. So there’s no problem, the problem occurs when rendering in our views.
Now to get it to work, i remove [‘middleware’ => [‘web’], in my routes its now like this

 

And it’s start working again as it should be… Hope this help you guys.. Thanks.

1070 Total Views 5 Views Today
Anthony Pillos

About Anthony Pillos

Developers.ph – We are Awesome. Tutorials in different programming languages like PHP,HTML5,JAVASCRIPT,CSS/CSS3,JQuery,Jquery Mobile, Responsive Design.

1071 Total Views 6 Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">