Build and work with Sweet Alert features, including publishing assets, using the helper facade, and adding confirm-delete UI patterns.
Use this skill when implementing or modifying UI flows that require modal confirmations, toasts, or inline alerts using the realrashid/sweet-alert Laravel package.
vendor:publish tags: sweetalert-view, sweetalert-config, sweetalert-asset).alert() helper or RealRashid\SweetAlert\Facades\Alert.data-confirm-delete attribute support for anchors that need confirmation before HTTP DELETE.php artisan vendor:publish --provider="RealRashid\SweetAlert\SweetAlertServiceProvider" --tag="sweetalert-config"
use RealRashid\SweetAlert\Facades\Alert;
Alert::success('Saved', 'Your changes were saved successfully');
return redirect()->back();
<a href="{{ route('posts.destroy', $post->id) }}" data-confirm-delete>Delete post</a>
When the user clicks this link, SweetAlert2 will prompt for confirmation and, upon confirm, the package will submit a DELETE form.
asset('vendor/sweetalert/sweetalert.all.js') references for the bundled file to avoid breaking changes when replacing the upstream JS bundle.php artisan boost:install to users who want Laravel Boost to pick up this package's guidelines and skills automatically.