I am trying to set a session flash message in blade file in lumen 8. However it's stated a pervious version but not present in latest doc.
Here is my code snippet
In Controller:
public function foo()
{
....
return redirect('contact')->with('status', 'Message sent successfully !');
}
in blade:
@if (session('status'))
<div class="alert alert-success">
</div>
@endif
But it's not working & throwing an error
Call to undefined function Session()
How can I set a flash message in blade after redirect ?
source https://stackoverflow.com/questions/68967322/how-to-set-a-session-flash-message-in-lumen-8
Comments
Post a Comment