Leverage Toastr for stylish toast notifications in Laravel with PHPFlasher. Add Toastr's sleek notifications to your Laravel projects effortlessly.
php-flasher/flasher-toastr-laravel is a Laravel package for leverage toastr for stylish toast notifications in laravel with phpflasher. add toastr's sleek notifications to your laravel projects effortlessly..
It currently has 31 GitHub stars and 613.283 downloads on Packagist (latest version v2.6.1).
Install it with composer require php-flasher/flasher-toastr-laravel.
Discover more Laravel packages by php-flasher
or browse all Laravel packages to compare alternatives.
Last updated
Laravel adapter for PHPFlasher Toastr. Seamlessly integrate Toastr notifications into Laravel applications.
composer require php-flasher/flasher-toastr-laravel
// Global helper
toastr()->success('Operation completed successfully!');
toastr()->error('An error occurred.');
toastr()->info('Information message.');
toastr()->warning('Warning message.');
// In controller
public function save(Request $request)
{
// Your logic...
toastr()->success('Changes saved!');
return redirect()->back();
}
// With options
toastr()->success('Success message', [
'timeOut' => 5000,
'positionClass' => 'toast-top-right',
]);
toastr() global helperToastrFactory type-hinted injectionPublish configuration:
php artisan flasher:install --config
Add to config/flasher.php:
return [
'plugins' => [
'toastr' => [
'options' => [
'timeOut' => 5000,
'progressBar' => true,
'positionClass' => 'toast-top-right',
],
],
],
];
Complete documentation: php-flasher.io