Add Elegant Flash Notifications For Laravel

 

You can now add Elegant  flash-notifications in laravel . actually this package uses   sweetalert for nice alerts in  your laravel app acording to author this package is based on Laracasts video tutorial . you should give a try to this package you can checkout sweet alert demo here

You can install this package very easily using composer just

Run the following command to install the package through Composer.

composer require srmklive/flash-notifications

or in your composer.json file, add "srmklive/flash-notifications": ">=0.1" then run

composer update

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

 

 

Now add service provider and facades

Service Provider
Srmklive\FlashAlert\FlashAlertServiceProvider::class,
Facade
'FlashAlert' => Srmklive\FlashAlert\Facades\FlashAlert::class,

Publish Configuration & Views

php artisan vendor:publish



Here is the basic usage of this package

Simply call on FlashAlert to set your desired flash notification. There are a number of methods to assign different levels of priority (info, success, warning, and error).

Success

FlashAlert::success('Success', 'This is a success message.');

Info

FlashAlert::info('Info', 'This is an info message.');

Warning

FlashAlert::warning('Warning', 'This is a warning message.');

Error

FlashAlert::error('Error', 'This is an error message.');

Rendering

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

@include('flashalert::alert')




Pin It on Pinterest

Shares

Get the best in web dev

Join dunebook.com and recieve best in web dev , once a week FREE

An email has been Sent to your Inbox ! Please Confirm your Subscription :)