Laraflash is a good package which provides a handy way to work with the flash messages.

flash message

Installation

You can install this package via composer using this command:

composer require coderello/laraflash

Examples

Adding the messages

laraflash()
  ->add()
  ->content('You have been registered successfully.')
  ->type('success')
  ->important();

Getting ready messages as an array

laraflash()->toArray();