caffeinated/flash

Laravel 5 Flash Messages
50,967 43
Install
composer require caffeinated/flash
Latest Version:v4.1.0
PHP:^7.2|^8.0
License:MIT
Last Updated:Mar 7, 2023
Links: GitHub  ·  Packagist
Maintainer: thekanbo

Caffeinated Flash Messages

Source License

Laravel 5 flash messages, based off the Laracasts video tutorial on the same topic: Flexible Flash Messages. Originally developed for FusionCMS, an open source content management system.

Quick Installation

Begin by installing the package through Composer.

composer require caffeinated/flash

Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php file:

Service Provider
Caffeinated\Flash\FlashServiceProvider::class,
Facade
'Flash' => Caffeinated\Flash\Facades\Flash::class,

And that's it! With your coffee in reach, start flashing out messages!

Usage

Usage is simple. Before redirecting to another page, simply call on Flash to set your desired flash message. There are a number of methods to assign different levels of priority (info, success, warning, and error).

Success
Flash::success('This is a success message.');
Info
Flash::info('This is an info message.');
Warning
Flash::warning('This is a warning message.');
Error
Flash::error('This is an error message.');

Rendering

To render your flash messages in your view, simply include the bundled view partial in your master layout:

@include('flash::message')

Note that the bundled view partial is geared for Bootstrap out of the box.

Related Packages

sun/laravel-flash

Sun Flash helps you to add flash messages to your Laravel application.

1,831 2
caffeinated/modules

Laravel Modules

676,866 949
edvinaskrucas/notification

Package for Laravel for helping to manage flash / instant notifications / messag...

402,639 518
szykra/laravel-flash-notifications

Easy way to display Flash Notifications in Laravel 5.

38,434 8

Version History

Version Released PHP Laravel License
v4.1.0 ^7.2|^8.0 ^6.0|^7.0|^8.0 MIT
v4.0.0 ^7.2 ^6.0|^7.0 MIT
v3.1.0 >=7.1.3 5.5.*|5.6.*|5.7.*|5.8.*|^6.0 MIT
v3.0.1 >=5.6.4 5.* MIT
v3.0 >=5.6.4 5.3.* MIT