๐ Laravel Toaster Magic โ v2.2.0 Release Notes
Release date: 2026-06-17
Type: Minor release โ fully backward compatible
v2.2.0 is a "Trust & Polish" release. The package's scope is unchanged โ it still does one thing, beautiful toast notifications for Laravel โ but it is now more reliable, better tested, more compatible, and more pleasant to use. No breaking changes: existing apps can upgrade without touching their code.
โจ Highlights
- โ Automated tests + CI across PHP 8.1โ8.5 and Laravel 10โ13 โ every release is now verified, with a build-status badge on the README.
- โฑ๏ธ Per-toast duration โ override
timeOut/showDurationfor a single toast. - ๐ฑ๏ธ Pause-on-hover โ the auto-dismiss timer pauses while a user is reading a toast.
- ๐งน Programmatic dismiss โ
toastMagic.clear()/toastMagic.dismissAll()from JavaScript. - ๐
preventDuplicatesnow actually works. - ๐งพ Validation
MessageBagsupport โ pass$validator->errors()straight into a toast. - ๐ช The documented fluent API now works โ
ToastMagic::dispatch()->success(...).
๐ What's New
Per-toast duration overrides
timeOut and showDuration can now be set per toast (in milliseconds), falling back to your global config when omitted:
ToastMagic::success('Saved!', 'Your changes are live.', [
'timeOut' => 10000, // keep this one on screen longer
'showDuration' => 300,
]);Also supported through Livewire event options.
Pause-on-hover
Toasts no longer disappear while a user is hovering over them. This is enabled by default. To restore the old always-auto-dismiss behavior, set:
// config/laravel-toaster-magic.php
'options' => [
'pauseOnHover' => false,
],Programmatic dismiss API
toastMagic.clear(); // dismiss all visible toasts
toastMagic.dismissAll(); // alias of clear()Validation errors in one line
ToastMagic::error($validator->errors());The MessageBag is flattened into a single toast, one message per line.
Fluent dispatch syntax
ToastMagic::dispatch()->success('User Created', 'The user has been created.');๐ Fixes
preventDuplicatesis now honored by the JavaScript runtime โ identical, currently-visible toasts (same type, heading, and description) are skipped when the option is enabled. Previously the option existed but did nothing.clear()now also clears already-queued messages from the session, not just the in-memory list.MessageBagpassed to a toast type no longer throws aTypeErrorโ the message-flattening path is now reachable.- The README
dispatch()example previously referenced a method that didn't exist; it now works as documented.
๐ Security note
The README's blanket "XSS Safe" wording has been corrected to be precise:
- Custom button URLs are sanitized.
- Toast heading/description content is rendered as HTML (this is what enables multi-line messages). Do not pass unescaped, user-supplied input into a toast โ escape it first, e.g. with Laravel's
e()helper.
ToastMagic::success('Welcome, ' . e($user->name) . '!');Coming in v3.0.0: message content will be escaped by default, with an opt-in flag for intentional HTML.
๐งฉ Compatibility
| Requirement | Supported |
|---|---|
| PHP | 8.0 โ 8.5 |
| Laravel | 8 โ 13 |
| Livewire | v3 & v4 |
composer.json now declares these constraints explicitly, so Composer can warn you about an incompatible stack.
Note: CI verifies PHP 8.1โ8.5 with Laravel 10โ13. PHP 8.0 and Laravel 8/9 remain supported per the declared constraints but are not exercised in the automated matrix (no current Laravel release runs on PHP 8.0).
โฌ๏ธ Upgrade Guide
composer update devrabiul/laravel-toaster-magicThat's it โ no code changes required. Assets are auto-refreshed on the next page load (or run php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider" to re-publish the config).
The only behavior change is pause-on-hover, which is on by default. If you specifically relied on toasts dismissing while hovered, set 'pauseOnHover' => false in your config.
๐ Thanks
Thanks to everyone using and reporting issues on Laravel Toaster Magic. If it helps you in production, consider planting a tree. ๐ฑ
Full changelog: see CHANGELOG.md.