NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2754 most downloaded on Packagist
A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript popup boxes for Laravel - rebuilt with a fluent, Laravel-native API.
Last release 1 months ago
07 Sep 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 34 of 35 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
35 releases · first in 2017
Version 8 rebuilds the package around a fluent, Laravel-native builder. The v7 API was one 700-line Toaster class; v8 is three purpose-built builders,
Version 8 rebuilds the package around a fluent, Laravel-native builder. The v7 API was one 700-line Toaster class; v8 is three purpose-built builders, five composable concerns, three enums, and a test suite that covers behaviour rather than the shape of the code.
Your existing code keeps working. alert()->success(), toast() and confirmDelete() display immediately the way they always did. A survey of five real applications using this package found Alert::success() in 52 files and none of the changed signatures anywhere.
AlertBuilder, ToastBuilder and InputBuilder, each with its own defaultsAlertType, InputType, Position) with IDE completionwhen()/unless() and macro() on every builder@sweetAlert Blade directive, replacing @include('sweetalert::alert')A dialog that can only ask a question is half a feature. v8 acts on the answer with no JavaScript on your side:
<a href="{{ route('posts.destroy', $post) }}" data-confirm-delete>Delete</a>
<a href="{{ route('posts.publish', $post) }}" data-confirm data-confirm-method="PUT">Publish</a>
<form method="POST" action="{{ route('orders.refund', $order) }}" data-confirm>
@csrf
<button type="submit">Refund</button>
</form>Override the copy per element with data-confirm-title, -text, -icon, -button and -cancel. On confirm the package builds a form with the CSRF token and the right method and submits it.
data-confirm-delete worked this way before, but only on the request where confirmDelete() had been flashed — on any other render the link was an ordinary link and the browser opened the destroy URL with a GET. The listener is always present now. Closes #174 and #183.
SweetAlert2 is fetched on the first click, so a page carrying only a guarded link ships no JavaScript until someone uses it. If it cannot be fetched, the browser's own confirm() is used — a guarded delete never goes through unasked because a CDN was down.
submitTo()The answer reaches your server instead of vanishing when the dialog closes:
Alert::input('What should we call you?')
->submitTo(route('profile.name'), 'POST', 'name')
->flash();Closes #147.
topLayer()Puts a popup in the browser's top layer, above any z-index — the answer to a toast rendering behind a navbar. Closes #158.
php artisan alert:upgrade --dry-runThe command rewrites the two methods whose signatures changed, the container binding, the moved SessionStore, the Blade include, and the config keys that break theming. It reads your code with PHP's own tokeniser rather than searching for text, so a ->html() call on an unrelated object, or the old binding name inside a comment, is reported rather than edited. Nothing is written without confirmation and vendor/ is never touched.
Run against five real third-party applications it scanned 1,065 files and rewrote 16, with no false positives and no broken syntax.
It exists because of html() specifically. v7's signature was html($title, $code, $icon); v8's is html($html). PHP ignores surplus arguments, so an un-migrated call does not error — it just stops working.
Two config keys to check if you published the config under v7: background, width and padding are now null by default. SweetAlert2 applies each as an inline style that beats every stylesheet, so a background value means no theme can ever change the popup colour. alert:upgrade fixes this for you.
PHP 8.3+ and Laravel 11, 12 or 13.
Full upgrade path: https://realrashid.github.io/sweet-alert/guide/upgrade-guide
One column per quarter.
Laravel 12 compatibility fix for Alert facade (Closes #181 )
SweetAlertServiceProvider::register() — the bind() call was incorrectly passing a third argument (ToSweetAlert class string as $shared), causing Alert::warning and other facade methods to fail under Laravel 12's stricter container resolution@method PHPDoc annotations to the Alert facade for full IDE and static-analysis supportThis is a documentation-only fix; there are no breaking changes.
v7.3.1
Added Laravel Boost AI guidelines and Boost Skill
Upgrade notes:
Upgraded SweetAlert2 to the latest version
Full Changelog: v7.1.1...v7.2.0
Added Laravel 10 Support
Upgraded SweetAlert2 to latest version
Full Changelog: v7.0.0...v7.1.0
Upgraded SweetAlert2 to latest version
Laravel 10 support by @dyaskur in #149
Full Changelog: v.5.1.1...v6.0.0
v5.1.0 Added Laravel 9 Support Bug Fixes Docs Updated
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Added flexibility to Always load the sweetalert.all.js and Never load the sweetalert.all.js by farhanianz
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Upgraded SweetAlert2 to latest version
Updated animation($showClass = [], $hideClass = []) to animation($showAnimation, $hideAnimation)
animation($showClass = [], $hideClass = []) to animation($showAnimation, $hideAnimation)- Added symfony/thanks - Docs Updated - Fix some bugs
Added Missing ^ indicator prevents Laravel from updating to 6.0.1 and up
- Added support for Laravel 6.0 - This release fixed #46 - Docs Updated - Fix some bugs
Upgraded SweetAlert2 to latest version
showConfirmButton() helper method
Added some new methods
alert() methodalert()->success() methodalert()->info() methodalert()->wanring() methodalert()->question() methodalert()->error() methodalert()->html() methodtoast() methodshowConfirmButton() helper methodshowCloseButton() helper methodshowCancelButton() helper methodpersistent() helper methodautoClose() helper methodtoToast() helper methodfooter() helper methodUpgraded SweetAlert2 to latest version
animation($showClass = [], $hideClass = [])buttonsStyling() methodiconHtml() methodanimation($showClass = [], $hideClass = []) methodbuttonsStyling() methodiconHtml() methodUpgraded SweetAlert2 to latest version
Changes
// From
public function toast($title = '', $type = '', $position = 'bottom-right'){...}
// To
public function toast($title = '', $type = ''){...}
// set the default position in package config file or use the helper method position()
Nothing published for this version
- Deprecated
Your coding agent can read these notes before it upgrades. Set up the MCP server →