Few examples of typical use

Adding the messages

You can add the flash message this way:

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

You are calling the ->add() method (that returns the new FlashMessage instance) on the FlashMessagesBag instance (that is returned by the laraflash() helper). All subsequent chained methods are called on the FlashMessage instance.

Of course, you are not limited to only one message. You can add any amount of messages.

The message added in the previous example will be available during the next request.
If you want your message to be ready during the current request, then you should chain the ->now() method.