I have a master.blade.php layout which is extended by all other views I have.
I made a custom filter that redirects using Redirect::guest(route('get.home.index'))->with('guest_popup', true);. But when I get on the home page the variable $guest_popup is undefined.
However it's in the session and is accessible using: Session::get('guest_popup'). Why?
Oddly enough, I ran into this recently. I used to do ->with('success', 'Saved!') then just use/check the $success variable in the view, but the latest project I set up wouldn't see the 'success' variable - so I had to use session('success'). Never bothered to find out if something has changed in the framework - but it's a bit annoying :-/
I could be wrong but I thought when you redirect()->with('foo', 'bar') it saves the data to session. If you want the data as a variable in your view, you need to do view()->with('foo', 'bar').