Skip to content

v4.2.0 - Drive loading spinners and live alert updates straight from PHP

Latest

Choose a tag to compare

@jantinnerezo jantinnerezo released this 18 May 08:49
· 1 commit to master since this release

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; triggers Swal.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 via Swal.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