xutl/laravel-notify is a Laravel package for this is a laravel flash notify message..
It currently has 0 GitHub stars and 46 downloads on Packagist.
Install it with composer require xutl/laravel-notify.
Discover more Laravel packages by xutl
or browse all Laravel packages to compare alternatives.
Last updated
A simple package for flashing messages to views in Laravel 5+.
First, require the package using composer like so:
composer require xutl/laravel-notify
Add the service provider and alias in the app.php file in Laravel.
'providers' => [
...
XuTL\Notify\FlashNotifyServerProvider::class,
],
...
'aliases' => [
...
'Notify' => XuTL\Notify\Notify::class,
],
To use Notify, simple add use Notify at the top of your php file and then call it using the Notify facade.
Notify::info('This is an info message');
Notify::success('This is a success message');
Notify::warning('This is a warning message');
Notify::error('This is an error message');
You can also add a title to the message if you would like:
Notify::error($message, $title); // By default, the $title variable is set to null.
Notify::error('Something is broken', 'ERROR MESSAGE');