Level 51
Why not using flash messages?
Before redirecting
session()->flash('success', 'Your message');
In blade
@if(session('success'))
{{ session('success') }}
@endif
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi , i know this is traditional question but may there's better way to do it , when we move the user from page to another with message like ?success=done , if the user write it at the link the message 'll visible cause we do it at blade like
@if(request()->has('subscription') == 'stopped')
<div class="alert alert-danger">
{{__('subscription_stopped')}}
</div>
@endif
so there's solutions like session etc .. what's best practice to do that ?
Why not using flash messages?
Before redirecting
session()->flash('success', 'Your message');
In blade
@if(session('success'))
{{ session('success') }}
@endif
Please or to participate in this conversation.