PHPackages                             php-flasher/flasher-sweetalert - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. php-flasher/flasher-sweetalert

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

php-flasher/flasher-sweetalert
==============================

PHPFlasher - A powerful &amp; easy-to-use package for adding flash messages to Laravel or Symfony projects. Provides feedback to users, improves engagement &amp; enhances user experience. Intuitive design for beginners &amp; experienced developers. A reliable, flexible solution.

v2.6.1(1mo ago)775.4k—8.9%7MITPHPPHP &gt;=8.2

Since Dec 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/php-flasher/flasher-sweetalert)[ Packagist](https://packagist.org/packages/php-flasher/flasher-sweetalert)[ Docs](https://php-flasher.io)[ GitHub Sponsors](https://github.com/yoeunes)[ RSS](/packages/php-flasher-flasher-sweetalert/feed)WikiDiscussions 2.x Synced 1w ago

READMEChangelogDependencies (3)Versions (140)Used By (7)

PHPFlasher SweetAlert Adapter (Prime)
=====================================

[](#phpflasher-sweetalert-adapter-prime)

[![Latest Version](https://camo.githubusercontent.com/2ca6e529e0ca645552e2fcf207c29c73ff31f5cd3be4093cdffe984ed7438e21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d666c61736865722f666c61736865722d7377656574616c6572742e737667)](https://packagist.org/packages/php-flasher/flasher-sweetalert)[![Total Downloads](https://camo.githubusercontent.com/f99f8eddc5ed04d87b82a8de4f36a4ac218081a0fb34da5e32ce6928071be30a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d666c61736865722f666c61736865722d7377656574616c6572742e737667)](https://packagist.org/packages/php-flasher/flasher-sweetalert)[![License](https://camo.githubusercontent.com/21cd1acbdd1fa2ee34d7cb4de2ec7fce205d0d883161eed70199a414fd7ed922/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068702d666c61736865722f666c61736865722d7377656574616c6572742e737667)](https://packagist.org/packages/php-flasher/flasher-sweetalert)

SweetAlert2 adapter for PHPFlasher. Beautiful alert dialogs with modal and toast support.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- PHPFlasher ^2.5.1

Installation
------------

[](#installation)

```
composer require php-flasher/flasher-sweetalert
```

Quick Start
-----------

[](#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
--------

[](#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
-----------------

[](#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
-------------

[](#documentation)

Complete documentation: [php-flasher.io](https://php-flasher.io)

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance89

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Recently: every ~4 days

Total

138

Last Release

57d ago

Major Versions

v0.9.7 → v1.0.22022-05-16

v1.15.14 → v2.0.02024-05-05

PHP version history (2 changes)v0.1.0PHP &gt;=5.3

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/719ac0f6bf24d689686134530caf539727d784ad4a66c81ad5dcdba161b4ea0a?d=identicon)[yoeunes](/maintainers/yoeunes)

---

Top Contributors

[![yoeunes](https://avatars.githubusercontent.com/u/10859693?v=4)](https://github.com/yoeunes "yoeunes (53 commits)")[![yoeunes-spin](https://avatars.githubusercontent.com/u/86292260?v=4)](https://github.com/yoeunes-spin "yoeunes-spin (2 commits)")

---

Tags

flash-messagesnotification-systemphpphp-flashersweetalertyoeunesflash-messageslaravel-notificationphp-notification-systemsymfony-notificationuser-feedback-toolsweb-application-notificationsphp-user-interfacecustomizable-alerts-phpinteractive-web-notificationsphp-messaging-libraryuser-engagement-php

### Embed Badge

![Health badge](/badges/php-flasher-flasher-sweetalert/health.svg)

```
[![Health](https://phpackages.com/badges/php-flasher-flasher-sweetalert/health.svg)](https://phpackages.com/packages/php-flasher-flasher-sweetalert)
```

###  Alternatives

[php-flasher/flasher-laravel

Seamlessly integrate flash notifications into your Laravel applications with PHPFlasher. Enhance user feedback and engagement with minimal setup.

452.9M45](/packages/php-flasher-flasher-laravel)[php-flasher/flasher-symfony

Integrate flash notifications into Symfony projects effortlessly with PHPFlasher. Improve user experience and application feedback loops easily.

141.3M26](/packages/php-flasher-flasher-symfony)[bentools/webpush-bundle

Send push notifications through Web Push Protocol to your Symfony users.

72285.7k](/packages/bentools-webpush-bundle)[calchen/laravel-dingtalk-robot-notification

钉钉智能群助手 Laravel/Lumen 消息通知扩展包（Dingtalk robot message notifications for Laravel/Lumen）

2326.5k](/packages/calchen-laravel-dingtalk-robot-notification)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
