routegroup/laravel-alert

Extended Laracasts Flash


Keywords
laravel, Laravel-Alert, routegroup
License
MIT

Documentation

laravel-alert

Installation

Run composer require routegroup/laravel-alert.

And then, if using Laravel 5, include the service provider within config/app.php.

'providers' => [
    'Routegroup\Alert\AlertServiceProvider'
];

And, for convenience, add a facade alias to this same file at the bottom:

'aliases' => [
    'Flash' => 'Routegroup\Alert\Alert'
];

Usage

Created

$user = User::create([...]);
alert($user)->created('Successful created message');

Update

Warning: If object has not anything changed then it will errors occured!

$user->fill([...]);
$user->save();
alert($user)->updated('Successful updated message');

Deleted

$user->delete();
alert($user)->deleted('Successful deleted message');