I found this issue and this one as well as this thread.
Seems you are running into an issue specific to 5.2. See the links for potential workarounds.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using Laravel 5.3.
I want to redirect back to a payment page if a user's credit card has been declined. When a user's card is declined they're redirected back to the payment page with the following:
return redirect()->back()->with('msg', "Your card was declined");
I am able to see this in my Controller.
$msg = (session('msg')) ? session('msg') : "";
I'm passing the $msg variable to my Controller...and trying to display it in the template but...nothing.
I am able to see the "msg" variable in debugbar.
I am NOT able to see the variable in my blade templates. session('msg') Session::get('msg') and every other option I was able to find do not work.
I'm trying to display the message in my template with the following:
@if (session('msg'))
<div class="alert alert-danger">
{{ session('msg') }}
</div>
@endif
It's almost like my view needs to be re-rendered in order to display the variable.
Any thoughts?
Thanks!
Please or to participate in this conversation.