devrabiul/laravel-toaster-magic
Dependency-free toast notifications for Laravel with Livewire v3/v4 support. Drop-in, customizable toasts with multiple modern themes, RTL + dark mode, XSS-safe links, and no need for jQuery, Bootstrap, or Tailwind.
composer require devrabiul/laravel-toaster-magic
php artisan vendor:publish --provider="Devrabiul\ToastMagic\ToastMagicServiceProvider"
config/laravel-toaster-magic.php for theme, position, and Livewire settings.ToastMagic::styles() and ToastMagic::scripts() to app.blade.php or layout templates.alert() or session flash messages with ToastMagic in controllers.dispatch('toastMagic', ...) for real-time feedback..toast-* classes. Mitigate by scoping toast styles (e.g., data-toast attributes).ToastMagic) and avoids global pollution.laravel/livewire package).app.blade.php → Test facade methods in controllers.--force) may be needed for major releases.preventDuplicates config.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Asset publishing fails | Toasts render without styles/JS | Manual asset republish (php artisan vendor:publish --force) |
| Livewire event misconfiguration | Toasts fail to appear | Validate livewire_enabled and version in config |
| CSS/JS conflicts | Toasts appear broken or misaligned | Scope styles with unique classes/attributes |
XSS via customBtnLink (theoretical) |
Malicious links execute | Package’s sanitizeUrl() already protects this |
| High-frequency toast spam | UI clutter, poor UX | Use preventDuplicates or debounce dispatching |
THEMES.md and CHANGELOG.md for advanced use cases.ToastMagic facade in PHPUnit tests.How can I help you explore Laravel packages today?