This package is abandoned and no longer maintained. No replacement package was suggested.

Alert messages for Laravel 5.

4.2.0 2019-08-28 12:59 UTC

This package is auto-updated.

Last update: 2020-01-28 14:13:08 UTC


Build Status PHP from Packagist Latest Version License


Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/alert

If you need to modify the configuration or the views, you can run:

php artisan vendor:publish --provider="Artisanry\Alert\AlertServiceProvider"

The package views will now be located in the app/resources/views/vendor/alert/ directory and the configuration will be located at app/config/alert.php.


Within your controllers, before you perform a redirect...

public function store(Alert $alert)
    alert()->info('Welcome Aboard!');

    return redirect()->route('dashboard');

You may also do:

  • alert()->flash('Message')
  • alert()->success('Message')
  • alert()->info('Message')
  • alert()->warning('Message')
  • alert()->error('Message')

Again, this will set one key in the session:

  • alert.messages - The messages you're alerting, each message is contained as an array
    • message - The message you're alerting
    • level - A string that represents the type of notification
    • title - A string that will show up as the modal title

Because alert messages and overlays are so common, if you want, you may use (or modify) the views that are included with this package. Simply append to your layout view:


Message (Defaults to Info)

alert()->flash('Welcome aboard!');

return redirect()->route('dashboard');


alert()->success('You successfully read this important alert message.');

return redirect()->route('dashboard');


alert()->info('This alert needs your attention, but it\'s not super important.');

return redirect()->route('dashboard');


alert()->warning('Better check yourself, you\'re not looking too good.');

return redirect()->route('dashboard');


alert()->error('Change a few things up and try submitting again.');

return redirect()->route('dashboard');

Laravel Validation

$validator = Validator::make(
    ['name' => 'Invalid'],
    ['name' => 'required|min:8']


return redirect()->route('dashboard');

Chain Messages

alert()->success('You successfully read this important alert message.')
       ->info('This alert needs your attention, but it\'s not super important.')
       ->warning('Better check yourself, you\'re not looking too good.')
       ->error('Change a few things up and try submitting again.')
       ->overlay('One fine body...');

return redirect()->route('dashboard');


$ phpunit


If you discover a security vulnerability within this package, please send an e-mail to All security vulnerabilities will be promptly addressed.


This project exists thanks to all the people who contribute.


Mozilla Public License Version 2.0 (MPL-2.0).