php-flasher/flasher-toastr-laravel
Laravel integration for php-flasher Toastr notifications. Quickly flash success, error, info, and warning messages to the browser using the Toastr JavaScript library, with simple configuration and support for Laravel’s session-based flashing.
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
How can I help you explore Laravel packages today?