Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Flasher Laravel Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

Implementation Patterns

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.

Gotchas and Tips

  • 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.
  • Avoid caching responses that include flash messages—Flasher relies on session state, and cached pages may show stale or missing notifications.
  • Tailwind or Bootstrap users: ensure you publish assets and match your theme (default_theme) to your CSS framework to avoid styling mismatches.
  • In tests, call flasher()->clear() after assertions to prevent flash pollution across test cases (especially in setUp() or tearDown()).
  • Watch for deprecation warnings in Laravel 10+ related to 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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4