Elegant notifications to laravel with Toastr or PNotify
helmesvs/laravel-notify is a Laravel package for elegant notifications to laravel with toastr or pnotify.
It currently has 61 GitHub stars and 28.082 downloads on Packagist (latest version v1.1.0).
Install it with composer require helmesvs/laravel-notify.
Discover more Laravel packages by helmesvs
or browse all Laravel packages to compare alternatives.
Last updated
Elegant notifications to laravel with Toastr or PNotify

composer require helmesvs/laravel-notify or add "helmesvs/laravel-notify" to the require key in composer.json and run composer install.Helmesvs\Notify\NotifyServiceProvider::class, to the providers key in config/app.php.'Notify' => Helmesvs\Notify\Facades\Notify::class, to the aliases key in config/app.php.php artisan vendor:publish --provider="Helmesvs\Notify\NotifyServiceProvider" --tag="notify" to publish the config file.{!! Notify::render() !!} in your master view template.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 notificationOpen 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.
'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.
'ToastrOptions' => [
"closeButton" => false,
"closeHtml" => '',
"newestOnTop" => true,
"progressBar" => false,
...
]
'PNotifyOptions' => [
'title_escape' => false,
'text_escape' => false,
'styling' => 'brighttheme',
'addclass' => '',
...
]
For a list of available options, see toastr.js' documentation and pnotify.js' documentation.