@khizerrashid I think the following code should be enough to display the session message. Why do you use extra if-else conditions? Do you really need that?
@if(Session::has("form_submit_flag")
{!! session("form_submit_msg") !!}
@endif
Summer Sale! All accounts are 50% off this week.
I am working on a Laravel project in which I am using flash session after form submit to display the message. But the problem is that the flash session message sometimes appears and sometime not. I know this issue occurs when we use a web middleware twice. But I did not use twice. It Applies as default. So what can be the other cause for this problem. Here is some piece of code. In controller function after saving data: return redirect()->back()->with(['form_submit_flag' => 'true', 'form_submit_msg' => 'Department Edited Successfully']);
In blade: @if(Session::has("form_submit_flag")) @if(session("form_submit_flag") == "true")
× Message! {!! session("form_submit_msg") !!}@elseif(session("form_submit_flag") == "false")
× Message! {!! session("form_submit_msg") !!} @endif @endifPlease or to participate in this conversation.