realrashid/sweet-alert
Laravel wrapper for SweetAlert2 that makes it easy to show stylish alert, toast, and confirmation dialogs. Flash messages from controllers or middleware, with helpers for success/error/warning/info, custom options, and Blade support for quick integration.
Alert::success("Saved!") in controllers) with zero JavaScript boilerplate.alert() calls with SweetAlert for critical paths (e.g., delete confirmations, success/error states).Session::flash() → Alert::toast()).try/catch alerts with styled toasts (e.g., "Payment failed: Invalid card").Alert::warning(__('Are you sure?'))).return Alert::error()->redirect('/dashboard'))."This package lets us ship polished user feedback faster by replacing clunky JavaScript alerts with a maintainable, Laravel-native solution. Think of it like upgrading from alert('Saved!') to a designer-approved, accessible toast system—but with zero frontend dev time. It’s already used by 1K+ Laravel apps, supports our latest Laravel 13 stack, and cuts alert-related bugs by standardizing the code. ROI: Faster iterations, better UX, and reduced tech debt."
Key Metrics to Track:
alert())."This is a drop-in replacement for all your alert(), toast(), and confirmation dialogs*. Here’s why it’s a win:
return Alert::success('User created!')->redirect('/users');
Migration Path:
alert('Error') with Alert::error()->toast() in critical paths.confirmDelete() middleware for all destructive actions.Trade-offs:
config/sweet-alert.php for theming/positioning.Docs: GitHub | Demo: SweetAlert2 Playground."*
How can I help you explore Laravel packages today?