dev-master
9999999-devEasy toastr notifications for Laravel 4
MIT
The Requires
- php >=5.3.0
- illuminate/support >=4.0.0
- illuminate/session >=4.0.0
by Kamal Nasser
Wallogit.com
2017 © Pedro Peláez
Easy toastr notifications for Laravel 4
Easy toastr.js notifications for Laravel 4, (*1)
composer require kamaln7/toastr dev-master or add "kamaln7/toastr": "dev-master" to the require key in composer.json and run composer install
'Kamaln7\Toastr\ToastrServiceProvider', to the providers key in app/config/app.php
'Toastr' => 'Kamaln7\Toastr\Facades\Toastr', to the aliases key in app/config/app.php
Include jQuery and toastr.js in your master view template, and the output of Toastr::render() afterwards:, (*2)
``` html {{ Toastr::render() }}, (*3)
Call one of these methods in your controllers to insert a toast: - `Toastr::warning($message, $title = null, $options = [])` - add a warning toast - `Toastr::error($message, $title = null, $options = [])` - add an error toast - `Toastr::info($message, $title = null, $options = [])` - add an info toast - `Toastr::success($message, $title = null, $options = [])` - add a success toast - `Toastr::add($type: warning|error|info|success, $message, $title = null, $options = [])` - add a toast - **`Toastr::clear()` - clear all current toasts** ### Setting custom Toastr options You can set custom options for Toastr. Run: ``` php php artisan config:publish kamaln7/toastr
to publish the config file for Toastr. Then edit app/config/packages/kamaln7/toastr/config.php and set the options array to whatever you want to pass to Toastr. These options are set as the default options and can be overridden by passing an array of options to any of the methods in the Usage section., (*4)
For a list of available options, see toastr.js' documentation., (*5)
Easy toastr notifications for Laravel 4
MIT