New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

srmklive/flash-notifications

Elegant Flash Notifications For Laravel
2,423 7
Install
composer require srmklive/flash-notifications
Latest Version:v0.1.5
License:MIT
Last Updated:Sep 1, 2017
Links: GitHub  ·  Packagist
Maintainer: srmklive

Flash Notifications

Laravel 5 flash notifications, originally developed after the Laracasts video tutorial : Elegant Flash Messaging which uses SweetAlert.

Quick Installation

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:

Service Provider
'Srmklive\FlashAlert\FlashAlertServiceProvider',  // Laravel 5.0
Srmklive\FlashAlert\FlashAlertServiceProvider::class, // Laravel 5.1 or greater
Facade
'FlashAlert' => 'Srmklive\FlashAlert\Facades\FlashAlert', // Laravel 5.0
'FlashAlert' => Srmklive\FlashAlert\Facades\FlashAlert::class,  // Laravel 5.1 or greater
Publish Configuration & Views
php artisan vendor:publish

Usage

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. Also add @yield('styles') & yield('scripts') in your master layout:

@include('flashalert::alert')

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released License
v0.1.5 MIT
v0.1.3 MIT
v0.1.2 MIT
v0.1.1 MIT
v0.1 MIT