devrabiul/laravel-toaster-magic
Laravel Toaster Magic is designed to be the only toaster package you'll need for any type of Laravel project. Whether you are building a corporate dashboard, a modern SaaS, a gaming platform, or a simple blog, I have crafted a theme that fits perfectly.
"One Package, Many Themes." β No need to switch libraries just to change the look.
This major release brings 7 stunning new themes, full Livewire v3/v4 support, and modern UI enhancements.
I have completely redesigned the visual experience. You can now switch between 7 distinct themes by simply updating your config.
| Theme | Config Value | Description |
|---|---|---|
| Default | 'default' |
Clean, professional, and perfect for corporate apps. |
| Material | 'material' |
Google Material Design inspired. Flat and bold. |
| iOS | 'ios' |
(Fan Favorite) Apple-style notifications with backdrop blur and smooth bounce animations. |
| Glassmorphism | 'glassmorphism' |
Trendy frosted glass effect with vibrant borders and semi-transparent backgrounds. |
| Neon | 'neon' |
(Dark Mode Best) Cyberpunk-inspired with glowing neon borders and dark gradients. |
| Minimal | 'minimal' |
Ultra-clean, distraction-free design with simple left-border accents. |
| Neumorphism | 'neumorphism' |
Soft UI design with 3D embossed/debossed plastic-like shadows. |
π How to use:
// config/laravel-toaster-magic.php
'theme' => 'neon',
I've rewritten the Javascript core to support Livewire v3 & v4 natively.
Livewire.on (v3) or standard event dispatching.wire:navigate.// Dispatch from component
$this->dispatch('toastMagic',
status: 'success',
message: 'User Saved!',
title: 'Great Job'
);
Want your toasts to pop without changing the entire theme? Enable Gradient Mode to add a subtle "glow-from-within" gradient based on the toast type (Success, Error, etc.).
// config/laravel-toaster-magic.php
'gradient_enable' => true
Works best with Default, Material, Neon, and Glassmorphism themes.
Don't want themes? Just want solid colors? Color Mode forces the background of the toast to match its type (Green for Success, Red for Error, etc.), overriding theme backgrounds for high-visibility alerts.
// config/laravel-toaster-magic.php
'color_mode' => true
I have completely modularized the CSS.
.theme-neon, .theme-ios) to prevent conflicts.body[theme="dark"].Upgrading from v1.x to v2.0?
Update Composer:
composer require devrabiul/laravel-toaster-magic "^2.0"
Check Config: If you have a published config file, add the new options:
'options' => [
'theme' => 'default',
'gradient_enable' => false,
'color_mode' => false,
],
'livewire_version' => 'v3',
v2.0 transforms Laravel Toaster Magic from a simple notification library into a UI-first experience. Whether you're building a sleek SaaS (use iOS), a gaming platform (use Neon), or an admin dashboard (use Material), there is likely a theme for you.
Enjoy the magic! πβ¨
JavaScript Stability Fixes: Resolved multiple JS-related issues that could cause inconsistent toast behavior in SPA and dynamic page loads. Toasts now render more reliably across Livewire, Alpine.js, and AJAX-driven views.
Improved Event Handling: Fixed edge cases where custom events were not always triggering toast notifications. Event listeners are now more predictable and better scoped.
DOM Ready & SPA Support: Enhanced initialization logic to ensure Toaster Magic works smoothly with page transitions, including Turbo, Inertia, and Livewire navigation.
Performance Tweaks: Reduced unnecessary DOM queries and optimized JS execution flow for faster toast rendering with lower overhead.
Backward Compatibility: Fully compatible with v1.5 and earlier versions β no breaking changes. Existing integrations continue to work without modification.
Documentation Updates: Updated frontend usage examples to reflect the improved JS behavior and best practices.
Version 1.6 focuses on frontend reliability and smoother user experience. With important JavaScript fixes and performance improvements, Toaster Magic now delivers more consistent notifications across modern, dynamic Laravel applications.
Exception Fallback Handling: Added robust exception handling across all toast operations. Now, unexpected errors are gracefully managed without breaking your application. Developers can also provide custom handlers via configuration.
Performance & Optimization: Optimized core toast logic for faster execution. Minified assets and reduced runtime overhead to make the package leaner and more efficient.
PHP & Laravel Compatibility: Fully compatible with PHP 8.0 β 8.4 and Laravel 8 β 12. This ensures smooth integration across modern Laravel projects.
Backward Compatibility: Upgrading from v1.x is seamless. All previous configurations and usages remain supported.
Documentation & Examples: Updated usage examples and configuration instructions for easier integration.
All other configurations remain backward-compatible.
This release focuses on stability, performance, and developer experience. With v1.5, Laravel Toaster Magic is more robust, optimized, and ready for modern Laravel projects.
This release brings exciting visual improvements with Gradient Effects, fixes for Color Mode, and reorganizes the asset directory structure for better maintainability and package publishing.
π New Feature: Gradient Effects
gradient_enable in the config to add smooth gradient backgrounds to all toast notifications.π¨ Fixed Color Mode
color_mode did not apply the correct colors for some toast types (success, error, warning, info).π Asset Directory Updates
artisan vendor:publish workflow.π§Ή Other Improvements
composer update devrabiul/laravel-toaster-magic
php artisan config:clear
// config/laravel-toaster-magic.php
return [
'options' => [
'gradient_enable' => true,
'color_mode' => true,
// other options...
],
'livewire_enabled' => true,
'livewire_version' => 'v3',
];
php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider"
Thanks to all contributors and community members for helping! β€οΈ
Happy Toasting! πβ¨
This release introduces a new Color Mode feature that automatically applies toast colors based on toast types, along with important fixes for SPA navigation issues to improve Livewire and frontend routing compatibility.
π¨ New Feature: Color Mode
color_mode in the config to automatically apply distinct colors for toast types (success, error, warning, info).π οΈ Fixed SPA Navigation Issues
π§Ή Other Improvements
composer update devrabiul/laravel-toaster-magic
php artisan config:clear
// config/laravel-toaster-magic.php
return [
'options' => [
// other options...
'color_mode' => true,
],
'livewire_enabled' => true,
'livewire_version' => 'v3',
];
Thanks to all community members who helped identify SPA navigation issues and supported the color mode feature development! β€οΈ
Happy Toasting! πβ¨
This release focuses on fixing the positionClass config issue and includes other small improvements to enhance your experience with Laravel Toaster Magic.
positionClass
The default positionClass in config/laravel-toaster-magic.php is now correctly set to:'positionClass' => 'toast-bottom-start',
If youβve not published the config, run:
php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider"
β¨ Improved Option Merging Logic
Custom options from your config() and runtime calls now merge more reliably.
π§Ή Minor Cleanup Small internal cleanups for better code quality.
composer update devrabiul/laravel-toaster-magic
Or,
composer update
php artisan config:clear
Big thanks to [@redredimano](https://github.com/redredimano) for reporting the config issue! β€οΈ
Happy Toasting! πβ¨ https://github.com/devrabiul/laravel-toaster-magic
I'm excited to announce v1.1 of Laravel Toaster Magic β a smooth and powerful toast notification package for Laravel and Livewire.
π₯ Material Design Theme
β Auto Asset Update Issue Fixed
β Livewire JavaScript Compatibility Fixed
wire:navigate and Livewire.on() events.Run:
composer update devrabiul/laravel-toaster-magic
(Optional) Re-publish the assets to get the new Material theme:
php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider"
Thank you for using Laravel Toaster Magic! βοΈ Star the repo if you find it useful. Contributions and feedback are always welcome!
Custom Button Support in Livewire Toasts:
You can now include custom buttons in your Livewire-dispatched toasts. Add a link with custom text directly inside the toast notification using the options parameter:
$this->dispatch('toastMagic',
status: 'success',
title: 'User Created',
message: 'The user has been successfully created.',
options: [
'showCloseBtn' => true,
'customBtnText' => 'Link Text',
'customBtnLink' => 'https://demo.com',
],
);
Improved Option Handling: The toast system now gracefully parses and applies advanced configuration options passed from Livewire, offering more control and flexibility.
Better UX with Optional Close Button:
Developers can now toggle a close button per toast using showCloseBtn, offering users manual dismissal options.
Refined Event Handling:
Fine-tuned the way toastMagic events are handled to improve reliability and compatibility across Livewireβs lifecycle events.
Livewire Script Path Issues Resolved: Fixed loading problems with Livewire v3 JavaScript assets to ensure correct path resolution and smooth integration.
Robust Fallbacks for Livewire Scripts: Improved fallback logic for loading core toaster scripts when Livewire assets are unavailable, preventing broken toast notifications.
Full Livewire v3 Support Added:
Seamless integration with Livewire v3 via $this->dispatch('toastMagic', ...) for easy toast notifications directly from Livewire components.
Configurable Livewire Settings:
New configuration options 'livewire_enabled' => true and 'livewire_version' => 'v3' allow developers to toggle and specify Livewire versions with ease.
Enhanced Developer Experience for Livewire Users: Improved asset loading and event dispatching designed to work flawlessly with Livewireβs lifecycle and script management.
A powerful and flexible Toaster package for Laravel applications, designed to enhance user experience with customizable toast notifications.
How can I help you explore Laravel packages today?