finds.dev← search

// the find

jantinnerezo/livewire-alert

★ 806 · PHP · MIT · updated May 2026

SweetAlert2 integration for Livewire

A Laravel Livewire package that wraps SweetAlert2 so you can trigger JS alert/toast/confirm dialogs from PHP without writing Alpine or vanilla JS yourself. Aimed at Laravel/Livewire (and Filament) devs who want polished modals and toasts without hand-rolling the JS wiring.

Clean, fluent facade API (LivewireAlert::title()->success()->show()) that reads well in controller/component code. Has CI running PHPUnit and PHPStan on every push, and the v4 rewrite added dependency injection and enums (Icon, Position, Event, Option) instead of magic strings, which is a real improvement over typical loose-string config in this kind of package.

Despite the README's "no JavaScript required" framing, you still have to npm install sweetalert2 and manually expose it as window.Swal — miss that step (easy to do with Vite bundling) and alerts silently fail with no PHP-side error. Test suite is a single LivewireAlertTest.php plus a spy/test component, thin for a package that claims to support toasts, timers, confirm dialogs, inputs, images, and in-place updates — a lot of that surface area is probably only exercised manually against the docs site, not in CI. All real documentation lives on an external site rather than in the repo, so there's no way to check feature details or history offline or via GitHub search. The v3→v4 jump is a breaking major refactor with no migration guide in the README itself, just a pointer to pin v3 or upgrade blind.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →