2017 © Pedro Peláez
 

library notify

Notifications for Laravel 5

image

coderjp/notify

Notifications for Laravel 5

  • Thursday, June 25, 2015
  • by coderjp
  • Repository
  • 2 Watchers
  • 21 Stars
  • 312 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

Laravel Notify (Laravel 5 Package)

Notifications for Laravel 5. This is a simple package that extends Illuminate MessageBag. It provides a simple interface for displaying notifications., (*1)

Please note, to show notifications on redirect this uses session flashing, therefore the messages are only stored for 1 page redirect, not indefinitely., (*2)

Installation

Require this package with composer using the following command:, (*3)

composer require coderjp/notify

Add the service provider to the providers array in config/app.php, (*4)

'Coderjp\Notify\NotifyServiceProvider',

Add the facade to the aliases array in config/app.php, (*5)

'Notify'    => 'Coderjp\Notify\Facades\Notify',

Generate the config file for changing various settings. This can be found in config/notify.php., (*6)

php artisan vendor:publish --provider=Coderjp\\Notify\\NotifyServiceProvider

Configuration

To add your own message types, add them to the types array in config/notify.php. By default the options are success, error, info., (*7)

Usage

Storing Notifications

Notifications can be either be displayed on redirect or on the current page., (*8)

To store a notification so it is displayed on the next redirect, call the type like so, (*9)

Notify::success('The user was added!');
Notify::error('There was a problem adding the user, Please try again');
Notify::info('The user\'s password was changed');

To store a notification so it is displayed on the current page, call the type like so, (*10)

Notify::successNow('The user was added!');
Notify::errorNow('There was a problem adding the user, Please try again');
Notify::infoNow('The user\'s password was changed');

Outputing Notifications

To output a certain type of notification, (*11)

if (Notify::has('success')
    <div class="alert alert-success">
        <ul>
        @foreach(Notify::get('success') as $message)
            <li>{{ $message }}</li>
        @endforeach
        </ul>
    </div>
@endif

To output all/any, (*12)

if (Notify::all())
    <div class="alert">
        <ul>
        @foreach(Notify::all() as $message)
            <li>{{ $message }}</li>
        @endforeach
        </ul>
    </div>
@endif

Contributions

If you feel that this project should do more, please open a pull request or open an issue for future improvements / functionality., (*13)

The Versions

25/06 2015

dev-master

9999999-dev

Notifications for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel message alert notify

25/06 2015

0.0.4

0.0.4.0

Notifications for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel message alert notify

26/05 2015

0.0.3

0.0.3.0

Notifications for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel message alert notify

26/05 2015

0.0.2

0.0.2.0

Notifications for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel message alert notify

21/05 2015

0.0.1

0.0.1.0

Notifications for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel message alert notify