Younes ENNAJI 6abae0bdde docs: add interactive playground page
Features:
- Hero section with animated background elements
- Embedded flasher-studio interactive component
- Quick theme preview buttons (12 popular themes)
- Pro tips section for better user experience
- CTA section linking to Laravel/Symfony guides
- Added playground to navigation menu
2026-03-01 22:02:13 +00:00
2024-04-09 07:57:01 +00:00
Wip
2025-03-28 13:05:26 +00:00
2024-04-09 07:57:01 +00:00
2025-03-08 18:05:43 +00:00
2024-10-19 22:01:40 +01:00
2024-04-09 07:57:01 +00:00
2025-03-08 12:31:44 +00:00
2024-04-09 07:57:01 +00:00
2024-04-09 07:57:01 +00:00
2024-04-09 07:57:01 +00:00
2025-03-08 18:05:43 +00:00
2024-10-19 22:11:20 +01:00
2024-04-09 07:57:01 +00:00
2024-04-09 07:57:01 +00:00
2024-10-06 15:54:53 +01:00
2024-04-09 07:57:01 +00:00
2024-04-09 07:57:01 +00:00
2026-02-25 10:26:04 +00:00
2026-03-01 20:15:46 +00:00
2024-04-09 07:57:01 +00:00
2024-04-09 07:57:01 +00:00
2025-02-21 18:52:39 +01:00
2026-03-01 20:15:46 +00:00
2026-03-01 20:15:46 +00:00
2025-03-08 18:05:43 +00:00
2024-04-09 07:57:01 +00:00

PHPFlasher Logo

Elegant Flash Notifications for PHP

One line of PHP. Beautiful notifications. Zero JavaScript.

Downloads Stars Release PHP Version License

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
26 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,
]);

26 Beautiful Themes

PHPFlasher includes 26 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
bootstrap Bootstrap style
ios Apple iOS notifications
slack Slack messaging style
material Google Material Design
tailwind Tailwind CSS inspired
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
shadow Soft shadow effects
spectrum Colorful spectrum
sunset Warm sunset colors
zen Calm minimal design

See all themes with live demos →


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
    }
}

Livewire documentation →


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


Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Contributors

Contributors

Support the Project

If PHPFlasher helps you build better applications, please consider:


License

PHPFlasher is open-source software licensed under the MIT license.


Made with ❤️ by Younes ENNAJI

Star if you find this useful!

Languages
PHP 72.9%
TypeScript 12.6%
SCSS 6.3%
Shell 4.8%
JavaScript 1.4%
Other 1.9%