Using laravel 5.3, I'm not sure why this isn't working but I'm trying to make a persistent flash (one that I will take down at a later date) so that any user, no matter their permissions or dashboard view, will see the same notification as long as it resides in the code base.
I simply want to return whichever dash with this flash but the below code is not showing the actual message for me on any dash or in the session debug. What am I doing wrong here?
Controller:
if ($user == "admin") {
$dashboard = route('adminDash');
} elseif ($user == "manager") {
$dashboard = route('managerDash');
} else {
return view('mainDash');
}
Session::reflash();
return redirect($dashboard)->with('warning', 'This is a test warning notification');
View:
@if(Session::has('warning'))
<div >
<p style="font-size: 18px;">{{ Session::get('warning') }}</p>
</div>
@endif