SweetAlert2 adapter for PHPFlasher. Beautiful alert dialogs with modal and toast support.
composer require php-flasher/flasher-sweetalert
// 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,
]);
success(), error(), info(), warning(), flash()timer, toast, position, showConfirmButton, showCancelButtonsweetalert() helper for quick access// 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);
Complete documentation: php-flasher.io
How can I help you explore Laravel packages today?