jantinnerezo/livewire-alert
Livewire Alert integrates SweetAlert2 with Laravel Livewire so you can fire toasts, confirmation dialogs, and flash messages straight from your components using a simple fluent API. It handles the JavaScript wiring, keeping all your alert logic in PHP—no front-end code required.
asLoading() + wire:poll + update() lets the server drive a persistent progress alert from PHP, so "Save", "Import", "Generate report", and Bus::batch() jobs can show real progress instead of a fire-and-forget toast. This is squarely a buy decision — the wrapper already abstracts SweetAlert2's showLoading() / update() / close() plumbing.update() does not merge config defaults — only explicitly-set options are emitted, so partial updates can behave differently than the initial show(); update() is a no-op with a console warning when no alert is visible, which needs graceful handling (not a user-facing error); asLoading() presets non-dismissable + backdrop-click-blocked, which needs a deliberate escape hatch plan for stuck jobs.Adopt when:
asLoading()/update()/close() removes real UX friction.Alertable changes are additive, so v4.2.0 is a non-breaking bump — cheap to evaluate behind a flag.Look elsewhere when:
Adoption checklist: confirm no third party implements Alertable (new interface methods require implementation despite "additive" framing); verify behavior in a non-dismissable loading state when a job hangs or the request fails; confirm wire:poll cadence won't overload your queue/DB; document the "no visible alert" no-op path so update() calls after navigation fail silently.
For executives: Version 4.2.0 turns our alert dialogs from static pop-ups into live status surfaces, driven entirely from the backend. In practice, that means users see a real progress indicator while imports, exports, payments, and background jobs run — instead of a toast that vanishes or a spinner we'd otherwise hand-build. It's a non-breaking patch to an existing dependency, so cost is near zero and it removes a known class of "did it work?" support tickets and premature re-submissions.
For engineering: Three additive methods on Alertable — asLoading() (non-dismissable preset + Swal.showLoading()), close(), and update() (fluent or explicit payload, backed by Swal.update()) — give components direct control of an open alert without close-and-reopen flicker. No breaking changes, no migration. Two behaviors to design around: fluent update() emits only explicitly-set options (no config-default merge), and update() when no alert is visible is a silent no-op with a console warning. Recommend wrapping the asLoading() → update() → close() sequence in a small helper with a failure/escape path, and adding a test that asserts the alert closes on job completion and on exception. Release notes have minor typos (e.g. "spinne", "calal") and an inconsistent changelog compare link — cosmetic, but worth a docs PR if we're pointing other teams at this.
How can I help you explore Laravel packages today?