qdev1000/laravel-notify
Laravel Notify
Elegant notifications to laravel with Toastr or PNotify

Installation
- Either run
composer require helmesvs/laravel-notifyor add"helmesvs/laravel-notify"to therequirekey incomposer.jsonand runcomposer install. - Add
Helmesvs\Notify\NotifyServiceProvider::class,to theproviderskey inconfig/app.php. - Add
'Notify' => Helmesvs\Notify\Facades\Notify::class,to thealiaseskey inconfig/app.php. - Run
php artisan vendor:publish --provider="Helmesvs\Notify\NotifyServiceProvider" --tag="notify"to publish the config file. - Include the output
{!! Notify::render() !!}in your master view template. - Optional: Modify the configuration file located in config/notify.php.
Usage
Call one of these methods in your controllers to insert a notification:
Notify::warning($message, $title = null, $options = [])- add a warning notificationNotify::error($message, $title = null, $options = [])- add an error notificationNotify::info($message, $title = null, $options = [])- add an info notificationNotify::success($message, $title = null, $options = [])- add a success notificationNotify::add($type: warning|error|info|success, $message, $title = null, $options = [])- add a notificationNotify::clear()- clear all current notification
Configuration
Open config/notify.php to adjust package configuration. If this file doesn't exist, run php artisan vendor:publish --provider="Helmesvs\Notify\NotifyServiceProvider" --tag="notify" to create the default configuration file.
General Options
'options' => [
'lib' => 'toastr',
'style' => 'custom'
]
Set 'lib' as toastr to use toastr.js or pnotify to use pnotify.js.
Set 'style' to 'custom' to use custom settings, or as 'default' to default library settings.
The style of notifications can be customized in public/vendor/Notify/style.css.
Options Toastr
'ToastrOptions' => [
"closeButton" => false,
"closeHtml" => '',
"newestOnTop" => true,
"progressBar" => false,
...
]
Options PNotify
'PNotifyOptions' => [
'title_escape' => false,
'text_escape' => false,
'styling' => 'brighttheme',
'addclass' => '',
...
]
For a list of available options, see toastr.js' documentation and pnotify.js' documentation.
Related Packages
pixelcostudios/notify
toastr.js, pnotify.js flush notifications for Laravel
39
0
alerts
flush
flush messages
flush notifications
laravel
laravel 5
laravel 5.6
laravel 5.7
laravel 5.8
laravel 6
laravel 7
laravel 8
laravel 8.1
laravel 8.2
laravel flush notifications
laravel notification
laravel pnotify
laravel toastr
lumen
messages
notification
php
pnotify
pnotify js
toastr
toastr js
yoeunes