Easy flash messages

v1.1.1 2020-11-13 18:17 UTC

This package is auto-updated.

Last update: 2020-11-13 18:19:18 UTC



Latest Stable Version Total Downloads Latest Unstable Version License

Laravel Flashes

Fast flash message integration.


From the command line, run:

composer require masterro/laravel-flashes


Somewhere set the flash message

  • flash("Hello, {$name}!");
  • flash("Hello, {$name}!", 'success');
  • flash()->error($message); // ->success(), ->info(), ->warning(), ->error()
  • Flash::info('Flash!');

Before closing </body> tag


Implement notify method

Package will trigger notify(message, type) global javascript function that you should implement. As an example here is bootstrap-notify implementation:

window.notify = (message, type = 'success', options = {}) => {
    if (type === 'error') {
        type = 'danger';

    return window.$.notify(window._.merge({
        message: message
    }, options), {
        type: type,
        animate: {
            enter: 'animated bounceIn',
            exit: 'animated bounceOut'
        z_index: 9999,
        delay: 7000,
        mouse_over: 'pause',
        offset: {
            x: 20,
            y: 30

It requires bootstrap, bootstrap-notify and animate.css You can install and require those with yarn or npm:

yarn add bootstrap-notify or npm i bootstrap-notify --save