A super lightweight library for handling flash messages in Laravel
balfour/laravel-flash-messages is a Laravel package for a super lightweight library for handling flash messages in laravel.
It currently has 0 GitHub stars and 25 downloads on Packagist (latest version 0.0.1-alpha).
Install it with composer require balfour/laravel-flash-messages.
Discover more Laravel packages by balfour
or browse all Laravel packages to compare alternatives.
Last updated
A super lightweight library for handling flash messages in Laravel.
This library is in early release and is pending unit tests.
composer require balfour/laravel-flash-messages
use Balfour\LaravelFlashMessages\FlashMessages;
// resolve the message container
$flash = app(FlashMessages::class);
// or
$flash = app('flash');
// flash a message
$flash->flash('error', 'You are not authorized.');
// flash a message with a title
$flash->flash('error', 'You are not authorized.', 'Oopsie');
// add a message to the current container
// this message won't flash to the next request
$flash->add('error', 'You are not authorized.');
// retrieve all flash message
$messages = $flash->all();
// wipe all messages
$messages->clear();