Skip to content

A super lightweight library for handling flash messages in Laravel

License

Notifications You must be signed in to change notification settings

balfour-group/laravel-flash-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-flash-messages

A super lightweight library for handling flash messages in Laravel.

This library is in early release and is pending unit tests.

Installation

composer require balfour/laravel-flash-messages

Usage

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();

About

A super lightweight library for handling flash messages in Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages