Flash messages

A flash message is stored in the session for the next request only, then disappears. It is used to confirm an action after a redirect, like "Product saved". You add it with with() on the redirect and read it in the view with session().

Example

return redirect()->route('produits.index')->with('succes', 'Produit enregistré');

Related concepts

The whole glossary