v4.2.0 — Drive loading spinners and live alert updates straight from PHP
Three new methods give your Livewire components server-driven control over an open alert — no more close-and-reopen flicker.
✨ New
asLoading(?string $title = null)— preset for non-dismissable spinne and backdrop clicks; triggersSwal.showLoading()on open. Default title'Loading...', override with a string argument.
LivewireAlert::title('Saving...')->asLoading()->show();close()— dismiss the current alert from the server.
LivewireAlert::close();update(?array $options = null)— mutate the open alert in place viaSwal.update(). Two forms:
Fluent — only explicitly-set options emitted, config defaults not merged:
LivewireAlert::title('Almost done')->text('90%')->update();Explicit payload:
LivewireAlert::update([
'title' => 'Almost done',
'text' => '90%',
]);No-op (with console warning) when no alert is visible. Guards run before calal` no longer throws.
🧩 Why this matters
Pair asLoading() + wire:poll + update() to drive Bus::batch() progreany phased task — all from PHP, with the alert updating live.
🛡 Contract
Alertable interface extended with the three new methods (additive — no break).
Full Changelog: v4.2.0...v4.2.0