Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ux Sweet Alert

Ux Sweet Alert Laravel Package

pentiminax/ux-sweet-alert

A Symfony UX integration for SweetAlert2 that lets you trigger polished alerts, confirmations, and toasts from PHP or Twig. It provides simple helpers and Stimulus-powered behavior so you can add rich, interactive dialogs without writing custom JavaScript.

View on GitHub
Deep Wiki
Context7

SweetAlert2 integration for Symfony

Frequently asked questions about Ux Sweet Alert
Can I use pentiminax/ux-sweet-alert in a Laravel application?
It is a Symfony UX package, not a native Laravel package, so it does not install as a drop-in Laravel alert solution. You can use it in Laravel only if you bridge its Twig helpers and Stimulus controller into Blade and Laravel's asset pipeline. For standard Blade-only Laravel apps, a Laravel-specific SweetAlert package is usually the lower-risk choice.
Does pentiminax/ux-sweet-alert provide Blade directives for Laravel?
No. The package provides PHP helpers and a Twig extension, so there are no built-in Blade directives. In Laravel you would need to create your own Blade component or directive that mirrors the Twig helper API and invokes SweetAlert2 or the Stimulus controller. This custom bridge is the main integration work.
How do I install pentiminax/ux-sweet-alert in Laravel with Vite?
You can install the Composer package, but Laravel will not auto-register the Symfony UX bundle or Twig extension. You must manually register the Stimulus controller in resources/js/app.js and ensure SweetAlert2 assets are available through Vite. Then create a Blade directive or component that calls the alert logic. Expect custom wiring rather than a supported Laravel install path.
What are the version requirements for pentiminax/ux-sweet-alert?
The v0.21.0 release targets Symfony UX 3.0 and may drop compatibility with Symfony UX 2.x. Symfony UX 3.0 likely requires PHP 8.1 or newer and specific frontend tooling, so verify those constraints before adopting it. The package is still pre-1.0, so API changes are possible.
Is pentiminax/ux-sweet-alert compatible with Laravel 10 or Laravel 11?
There is no official Laravel support indicated, so Laravel 10 and 11 compatibility depends on your manual bridge. The package itself is not tied to Laravel versions, but its Symfony UX 3.0 dependency and asset setup must work with your PHP and Vite configuration. Test the Stimulus controller registration and Twig-to-Blade replacement carefully.
Can I use the Stimulus controller without Symfony UX?
Technically yes, but you lose the package's main convenience: the Twig extension. You would need to copy or reference the compiled Stimulus controller, register it in your Laravel JavaScript entry point, and invoke alerts directly. This is feasible for teams already using Stimulus, but it is not a supported Laravel integration.
Does the package ship compiled JavaScript or require TypeScript compilation?
The Stimulus controller was refactored from JavaScript to TypeScript, which adds a build step for contributors. Consumers should check whether the published package includes pre-built assets before assuming no Node build is needed. If compiled assets are not shipped, you will need to compile them for your Laravel Vite setup.
How does pentiminax/ux-sweet-alert compare to realrashid/sweet-alert for Laravel?
pentiminax/ux-sweet-alert is built for Symfony UX with Twig and Stimulus, while realrashid/sweet-alert is a Laravel-specific package designed for Blade and Laravel conventions. For a standard Laravel app, realrashid/sweet-alert is usually faster to install and lower risk. Choose the Symfony package only if you already use Stimulus and are prepared to maintain a custom Blade bridge.
Is pentiminax/ux-sweet-alert production-ready and well maintained?
It is a small, community-maintained package with pre-1.0 versioning, so breaking changes are possible between releases. Support is primarily through GitHub issues and Symfony UX community channels, and Laravel-specific questions are unlikely to be answered. For production Laravel use, consider a wrapper or fork and monitor changelogs closely.
How do I trigger SweetAlert2 confirmations and toasts from PHP in Laravel?
There is no native Laravel PHP helper, so you would build a Blade directive or component that outputs the JavaScript or data attributes needed by the Stimulus controller. Start with one alert type, such as a success flash message, then expand to confirmations and toasts. Keep SweetAlert2 options centralized in your bridge to match the package's configuration style.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource