Laravel – how to use session flash messages

In this post, Showing you how to use Laravel session flash messages.

Many times we need sessions only for show success or error messages on next page so we use session flash method who is destroyed after use at one time.  checkout this code:

Controllers code:

View Code:

we can set flash message with back()->with(‘message’,’my message’) as follow :

If you really like this post. Please Comment or share with social buttons for others help. You can more read useful articles


Add a Comment

Your email address will not be published. Required fields are marked *