Skip to content
Advertisement

Laravel 7 does not display flash message

JavaScript

I’m not sure if it has anything to do with it, but I believe it may be something related to my routes, I may be talking nonsense.

No flash message is being displayed, I was only able to display a message by setting it to Session::put, retrieving it in the view and then deleting it.

JavaScript

When I use with, withErrors, flash on the front always returns null.

JavaScript

In the view I’ve tried several ways, all of them have the same result. EXCEPT when I use Session::put manually to store the return message.

JavaScript

This is my model that I use on routes.

JavaScript

I have no problem using Session :: put, however, the returns from my Form Requests Rules are also not displayed and this is causing me a problem.

Advertisement

Answer

After asking the question, I decided to take a test that I had not yet done.

I commented on the kernel the class: StartSession::class and ShareErrorsFromSession::class.

As planned, the sessions stopped working.

In my case, I had to move both classes from $ middlewareGroups to $ middleware, this solved my problem above.

I changed that:

JavaScript

for this

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement