Problems with flash in chained redirect

Hello,

I need to do a redirect, check something, and then (possible) do another redirect.
Before each redirect, I add a different flash message.

So, in the component of the start.route, I have

request()->session()->flash('message', 'Redirection 1 with flash');

return redirect()->route('first.route');

Then, in the component of the first.route I have:

request()->session()->flash('message', 'Redirection 2 with flash');

return redirect()->route('second.route');

The problem is that the flash message is not present in the second.route request so I am not able to use it.

Is there any workaround for that?

Thank you for your time,

Try to change flash message key!

Thank you very much, @skywalker.

Same situation with any message key.

Maybe try to flash the session in the redirection itself. Meaning, use laravel way

return redirect()->route('second.route')->with('second 'Your successes message');

in blade

@if(session()->has('second')
  {{ session()->get('second') }}
@endif

Hope this help.