Files
php-flasher/src/Laravel/README.md
T
2024-09-21 19:14:36 +01:00

6.2 KiB

PHPFlasher Logo

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
Younes ENNAJI

💻 📖 🚧
Salma Mourad
Salma Mourad

💵
Nashwan Abdullah
Nashwan Abdullah

💵
Arvid de Jong
Arvid de Jong

💵
Ash Allen
Ash Allen

🎨
Tony Murray
Tony Murray

💻
Stéphane P
Stéphane P

📖
Lucas Maciel
Lucas Maciel

🎨
Antoni Siek
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