mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
6.2 KiB
6.2 KiB
PHPFlasher for Laravel
PHPFlasher provides a powerful and intuitive way to add flash notifications to your Laravel applications. With PHPFlasher, you can enhance user feedback efficiently and elegantly.
Official Documentation
For more comprehensive documentation, please visit PHPFlasher's Official Documentation.
Requirements
- PHP v8.2 or higher
- Laravel v11.0 or higher
Installation
To install PHPFlasher for Laravel, use Composer:
composer require php-flasher/flasher-laravel
After installation, publish the assets using:
php artisan flasher:install
Usage
Quickly integrate flash notifications in your Laravel project using the simple methods provided by PHPFlasher.
- Display a success message.
flash()->success('Operation completed successfully.');
- Display an error message.
flash()->error('Oops, something went wrong.');
- Display a warning message.
flash()->warning('Your account may have been compromised.');
- Display an informational message.
flash()->info('This may take some time. Do not refresh the page.');
- Set multiple options at once.
flash()
->options(['timeout' => 5000, 'position' => 'top-right'])
->success('Your profile has been updated.');
- Set a single option.
flash()
->option('timer', 5000)
->success('Your reservation has been confirmed.');
- Set the priority of the message.
flash()
->priority(1)
->success('Your subscription has been activated.');
- Set how many requests a message should persist through.
flash()
->hops(2)
->info('Your account has been created, but requires verification.');
- Translate a message into the specified language.
flash()
->translate('ar')
->success('Your message has been sent.');
Contributors
Younes ENNAJI 💻 📖 🚧 |
Salma Mourad 💵 |
Nashwan Abdullah 💵 |
Arvid de Jong 💵 |
Ash Allen 🎨 |
Tony Murray 💻 |
Stéphane P 📖 |
Lucas Maciel 🎨 |
Antoni Siek 💻 |
Contact
For support, feature requests, or contributions, reach out via:
License
PHPFlasher is licensed under the MIT license.
Made with ❤️ by Younes ENNAJI
