php-flasher/flasher-sweetalert
PHPFlasher - A powerful & easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement & enhances user experience. Intuitive design for beginners & experienced developers. A reliable, flexible solution.
90,025
7
| Install | |
|---|---|
composer require php-flasher/flasher-sweetalert |
|
| Latest Version: | v2.6.3 |
| PHP: | >=8.2 |
| License: | MIT |
| Last Updated: | Aug 31, 2026 |
| Links: | GitHub · Packagist |
Maintainer: yoeunes
PHPFlasher SweetAlert Adapter (Prime)
SweetAlert2 adapter for PHPFlasher. Beautiful alert dialogs with modal and toast support.
Requirements
- PHP >= 8.2
- PHPFlasher ^2.5.1
Installation
composer require php-flasher/flasher-sweetalert
Quick Start
// Basic usage
sweetalert('Operation completed successfully!', 'success');
sweetalert('An error occurred.', 'error');
sweetalert('Information message.', 'info');
sweetalert('Warning message.', 'warning');
// With options
sweetalert('Success message', 'success', [
'timer' => 3000,
'toast' => true,
'position' => 'top-end',
]);
// Modal dialog with options
sweetalert('Profile updated!', 'success', [
'confirmButtonText' => 'Great!',
'timer' => 5000,
]);
Features
- Simple API:
success(),error(),info(),warning(),flash() - SweetAlert2 Options:
timer,toast,position,showConfirmButton,showCancelButton - Modal Support: Full SweetAlert2 modal dialogs and toasts
- Type Safety: Full PHP type hints and PHPStan support
- Helper Functions: Global
sweetalert()helper for quick access
Available Methods
// Success notification
sweetalert($message, 'success', $options, $title);
// Error notification
sweetalert($message, 'error', $options, $title);
// Info notification
sweetalert($message, 'info', $options, $title);
// Warning notification
sweetalert($message, 'warning', $options, $title);
// Custom notification type
sweetalert($message, $type, $options, $title);
// With options
sweetalert($message, 'success', [
'timer' => 3000,
'toast' => true,
'position' => 'top-end',
], $title);
Documentation
Complete documentation: php-flasher.io
License
Related Packages
php-flasher/flasher-toastr
PHPFlasher Toastr - An extension for PHPFlasher to integrate Toastr notification...
1,441,794
8
php-flasher/flasher-notyf
PHPFlasher - A powerful & easy-to-use package for adding flash messages to Larav...
1,254,608
9
php-flasher/flasher-noty
PHPFlasher - A powerful & easy-to-use package for adding flash messages to Larav...
1,029,007
6
lab123/lumen-notification
Laravel Notifications wiring for Illuminate-based apps (ex-Lumen): service provi...
51,378
2
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v2.6.3 | >=8.2 | MIT | |
| v2.6.2 | >=8.2 | MIT | |
| v2.6.1 | >=8.2 | MIT | |
| v2.6.0 | >=8.2 | MIT | |
| v2.5.2 | >=8.2 | MIT | |
| v2.5.1 | >=8.2 | MIT | |
| v2.5.0 | >=8.2 | MIT | |
| v2.4.0 | >=8.2 | MIT | |
| v2.3.0 | >=8.2 | MIT | |
| v2.2.2 | >=8.2 | MIT | |
| v2.2.1 | >=8.2 | MIT | |
| v2.2.0 | >=8.2 | MIT | |
| v2.1.6 | >=8.2 | MIT | |
| v2.1.5 | >=8.2 | MIT | |
| v2.1.3 | >=8.2 | MIT | |
| v2.1.2 | >=8.2 | MIT | |
| v2.1.1 | >=8.2 | MIT | |
| v2.1.0 | >=8.2 | MIT | |
| v2.0.4 | >=8.2 | MIT | |
| v2.0.3 | >=8.2 | MIT | |
| v2.0.2 | >=8.2 | MIT | |
| v2.0.1 | >=8.2 | MIT | |
| v2.0.0 | >=8.2 | MIT | |
| v1.15.14 | >=5.3 | MIT | |
| v1.15.13 | >=5.3 | MIT | |
| v1.15.12 | >=5.3 | MIT | |
| v1.15.11 | >=5.3 | MIT | |
| v1.15.10 | >=5.3 | MIT | |
| v1.15.9 | >=5.3 | MIT | |
| v1.15.8 | >=5.3 | MIT |
Showing the latest 30 of 137. See every release on Packagist