A
A
AleDv2016-07-11 14:53:22
Laravel
AleDv, 2016-07-11 14:53:22

Why might flash messages not be processed in Laravel 5.2?

Hello. When saving the model, I call the following redirect:

return redirect('/admin/news')->with('success_message', News::$add_success);

On the template page, I catch similar messages with conditions like:
@if(Session::has('success_message'))
    <div class="alert alert-success">
        {{ Session::get('success_message') }}
    </div>
@endif

However, when saving the model and working out the redirect, the session is empty. In what a problem can be - I do not understand. I don't forcibly clear the session anywhere.
Maybe I missed something, I don't know.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rikcon, 2016-07-11
@AleDv

The route where /admin/news is wrapped in web middleware?
Since 5.2 Session only works if the web middleware is running.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question