Level 1
$request->session()->flash('status', 'Task was successful!');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello.
I'm trying to flash a message after user registration.
I copied the registered method and paste it in RegisterController :
protected function registered(Request $request, $user)
{
session()->flash('points','You have 5 points !');
}
I'm not getting anything when dd(session()->all()).
it works only when I use Session::put() .
I'm calling the session in my view like this :
@if(session('points'))
<script>
Swal.fire({
title: '{{session('points')}}',
text: '{{auth()->user()->badges->first()->description}}',
})
</script>
@endif
I upgraded from Laravel's5.8 to 6.
I did test the session in other controllers which are working fine.
can't figure this out :\ any idea what's going on?
Please or to participate in this conversation.