php-flasher / php-flasher
The core repository for PHPFlasher, hosting the source code, contributions, issue tracking, and discussions for the PHPFlasher project. This mono-repo serves as the hub for development and community engagement.
Fund package maintenance!
Requires
- php: >=8.2
- ext-intl: *
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- laravel/octane: ^2.3
- livewire/livewire: ^3.0
- paragonie/random_compat: ^2.0
- psr/container: ^1.1|^2.0
- symfony/config: ^7.0|^8.0
- symfony/console: ^7.0|^8.0
- symfony/dependency-injection: ^7.0|^8.0
- symfony/framework-bundle: ^7.0|^8.0
- symfony/http-kernel: ^7.0|^8.0
- symfony/translation: ^7.0|^8.0
- symfony/twig-bundle: ^7.0|^8.0
- symfony/ux-twig-component: ^2.19
- yoeunes/regex-parser: ^1.0
Requires (Dev)
- larastan/larastan: ^2.9.9
- mockery/mockery: ^1.6.12
- orchestra/testbench: ^9.5.2
- overtrue/phplint: ^9.5.3
- php-cs-fixer/shim: ^3.64.0
- phpstan/phpstan: ^1.12.7
- phpstan/phpstan-mockery: ^1.1.3
- phpstan/phpstan-phpunit: ^1.4.0
- phpstan/phpstan-symfony: ^1.4.10
- phpunit/phpunit: ^10.5.26
- rector/rector: ^1.2.8
- rector/swiss-knife: ^1.0.0
- symplify/monorepo-builder: ^11.2.22
- 2.x-dev
- v2.5.1
- v2.5.0
- v2.3.0
- v2.2.0
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.15.14
- v1.15.13
- v1.15.12
- v1.15.11
- v1.15.10
- v1.15.9
- v1.15.8
- v1.15.7
- v1.15.6
- v1.15.5
- v1.15.4
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.1
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.1
- v1.12.0
- v1.11.0
- v1.10.6
- v1.10.5
- v1.10.4
- v1.10.3
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.0
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.17
- v0.4.16
- v0.4.15
- v0.4.14
- v0.4.13
- v0.4.12
- v0.4.11
- v0.4.10
- v0.4.9
- v0.4.8
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2026-03-29 22:17:08 UTC
README
Elegant Flash Notifications for PHP
One line of PHP. Beautiful notifications. Zero JavaScript.
Documentation · Live Playground · Report Bug
Quick Start
Laravel:
composer require php-flasher/flasher-laravel && php artisan flasher:install
Symfony:
composer require php-flasher/flasher-symfony && php bin/console flasher:install
That's it! Now use it:
flash()->success('Welcome aboard! Your account is ready.');
Why PHPFlasher?
| PHPFlasher | Others | |
|---|---|---|
| Zero JavaScript | Write PHP only, frontend handled automatically | Requires manual JS setup |
| Auto Asset Injection | CSS/JS injected automatically | Manual script tags needed |
| 17 Built-in Themes | Amazon, iOS, Slack, Material & more | Limited or no themes |
| 4 Notification Libraries | Toastr, SweetAlert, Noty, Notyf | Single library only |
| Livewire Integration | Full event system support | Limited or none |
| RTL Support | Built-in right-to-left | Often missing |
| Framework Agnostic | Laravel, Symfony, or vanilla PHP | Framework-specific |
Notification Types
flash()->success('Operation completed successfully!'); flash()->error('Oops! Something went wrong.'); flash()->warning('Please backup your data before continuing.'); flash()->info('A new version is available for download.');
With Titles
flash()->success('Your changes have been saved.', 'Update Complete'); flash()->error('Unable to connect to server.', 'Connection Failed');
With Options
flash()->success('Profile updated!', [ 'position' => 'bottom-right', 'timeout' => 10000, ]);
17 Beautiful Themes
PHPFlasher includes 17 professionally designed themes ready to use:
flash()->success('Welcome!', ['theme' => 'amazon']); flash()->success('Welcome!', ['theme' => 'ios']); flash()->success('Welcome!', ['theme' => 'slack']); flash()->success('Welcome!', ['theme' => 'material']);
View All Themes
| Theme | Style |
|---|---|
flasher |
Default clean design |
amazon |
Amazon-inspired e-commerce |
ios |
Apple iOS notifications |
slack |
Slack messaging style |
material |
Google Material Design |
google |
Google notifications |
facebook |
Facebook style |
minimal |
Ultra-clean minimal |
amber |
Warm amber tones |
aurora |
Gradient effects |
crystal |
Transparent design |
emerald |
Modern green palette |
jade |
Soft jade colors |
neon |
Bright attention-grabbing |
onyx |
Dark mode sleek |
ruby |
Bold ruby accents |
sapphire |
Elegant blue style |
Notification Libraries
Need more features? Use popular notification libraries:
Toastr
composer require php-flasher/flasher-toastr-laravel
toastr()->success('Profile saved!', [ 'positionClass' => 'toast-bottom-right', 'progressBar' => true, ]);
SweetAlert
composer require php-flasher/flasher-sweetalert-laravel
sweetalert() ->showDenyButton() ->showCancelButton() ->warning('Do you want to save changes?');
Noty
composer require php-flasher/flasher-noty-laravel
noty()->success('Data synchronized!', [ 'layout' => 'topCenter', 'timeout' => 3000, ]);
Notyf
composer require php-flasher/flasher-notyf-laravel
notyf()->success('Upload complete!', [ 'dismissible' => true, 'ripple' => true, ]);
Livewire Integration
PHPFlasher integrates seamlessly with Laravel Livewire:
use Livewire\Attributes\On; class UserProfile extends Component { public function save() { // Save logic... sweetalert() ->showDenyButton() ->success('Save changes?'); } #[On('sweetalert:confirmed')] public function onConfirmed(array $payload): void { // User clicked confirm $this->user->save(); flash()->success('Profile saved!'); } #[On('sweetalert:denied')] public function onDenied(array $payload): void { // User clicked deny } }
Configuration
Laravel
// config/flasher.php return [ 'default' => 'flasher', 'themes' => [ 'flasher' => [ 'options' => [ 'timeout' => 5000, 'position' => 'top-right', ], ], ], ];
Symfony
# config/packages/flasher.yaml flasher: default: flasher themes: flasher: options: timeout: 5000 position: top-right
Common Options
| Option | Type | Default | Description |
|---|---|---|---|
timeout |
int | 5000 |
Auto-dismiss delay in ms (0 = sticky) |
position |
string | top-right |
top-right, top-left, bottom-right, bottom-left, top-center, bottom-center |
closeButton |
bool | true |
Show close button |
progressBar |
bool | true |
Show timeout progress bar |
rtl |
bool | false |
Right-to-left text direction |
escapeHtml |
bool | true |
Escape HTML in messages |
Requirements
| Requirement | Version |
|---|---|
| PHP | >= 8.2 |
| Laravel | >= 11.0 |
| Symfony | >= 7.0 |
Documentation
For complete documentation, visit php-flasher.io
- Installation Guide
- Laravel Integration
- Symfony Integration
- Livewire Integration
- Inertia.js Integration
- Themes Gallery
- JavaScript Usage
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Contributors
Support the Project
If PHPFlasher helps you build better applications, please consider:
- Star this repository to show your support
- Report bugs to help improve the library
- Share on Twitter to spread the word
License
PHPFlasher is open-source software licensed under the MIT license.
Made with ❤️ by Younes ENNAJI
⭐ Star if you find this useful!