Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

panthro's avatar

Passing a message back with a redirect

How can I pass back a message to the user upon a successful form submission and a redirect?

Is it as simple as this?

redirect()->route('somewhere.index')
        ->with('message', 'Record added successfully!');

From Google i've seen flashing messages to the session, does the above achieve the same thing?

0 likes
2 replies

Please or to participate in this conversation.