php-flasher/flasher-laravel
Laravel integration for PHP Flasher: add stylish flash notifications (success, error, info) to your app with an easy API, session support, and multiple adapters/themes. Quick to install, configurable, and works seamlessly with Laravel’s middleware and views.
Install via Composer and publish the config to get up and running in minutes. Begin with the simplest use case: triggering a success flash in a controller after a form submission, then render it in your Blade layout. No complex setup required—just call flasher()->addSuccess() and include {{ flasher()->render() }} near the end of your main layout file.
Leverage the intuitive helper methods (addSuccess, addError, etc.) for common feedback flows (e.g., form validation, CRUD operations). Use per-message options (like auto_hide, position, timeout) for fine-grained control, or configure defaults globally in config/flasher.php. Integrate cleanly into jobs, listeners, and middleware—ideal for centralized notification handling. For SPAs or AJAX-heavy apps, fetch messages via getFlashMessages() and render them dynamically on the frontend using your framework of choice.
flasher()->render() must be included in the final rendered HTML (outside any conditionals or closures) for JS to bind correctly—common mistake: placing it inside a modal or component that may not always render.default_theme) to your CSS framework to avoid styling mismatches.flasher()->clear() after assertions to prevent flash pollution across test cases (especially in setUp() or tearDown()).Session::flash()—enable legacy_flash_support in config as a short-term fix, but plan to migrate to Flasher’s native session handling long term.How can I help you explore Laravel packages today?