2017 © Pedro Peláez
 

library laravel-flashes

Easy flash messages

image

masterro/laravel-flashes

Easy flash messages

  • Friday, June 15, 2018
  • by MasterRO
  • Repository
  • 1 Watchers
  • 2 Stars
  • 88 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 214 % Grown

The README.md

, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License , (*2)

StandWithUkraine , (*3)

Easy Flash Messages for Laravel

Fast flash message integration., (*4)

Installation

From the command line, run:, (*5)

composer require masterro/laravel-flashes

Usage

Somewhere set the flash message

  • flash("Hello, {$name}!");
  • flash("Hello, {$name}!", 'success');
  • flash()->error($message); // ->success(), ->info(), ->warning(), ->error()
  • flash()->with(['body' => 'My custom body text']); // ->success(), ->info(), ->warning(), ->error()
  • Flash::info('Flash!');

Before closing </body> tag

@include('flash-messages::script'), (*6)

or implement your own render logic, (*7)

php artisan vendor:publish --tag=flash-messages-views, (*8)

Implement notify method (bootstrap-notify example)

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

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:, (*10)

yarn add bootstrap-notify or npm i bootstrap-notify --save, (*11)

The Versions

15/06 2018

dev-master

9999999-dev

Easy flash messages

  Sources   Download

MIT

The Requires

 

by Roman Ihoshyn

laravel messages session flash flash-messages

19/03 2018

v0.1.1

0.1.1.0

Easy flash messages

  Sources   Download

MIT

The Requires

 

by Roman Ihoshyn

laravel messages session flash flash-messages

14/08 2017

v0.1.0

0.1.0.0

Easy flash messages

  Sources   Download

MIT

The Requires

 

by Roman Ihoshyn

laravel messages session flash flash-messages