Weave 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

Flash Laravel Package

caffeinated/flash

Caffeinated Flash is a Laravel package for session-based flash notifications with a fluent API. It supports Bootstrap-style alert levels, multiple messages, and customizable templates, letting you queue success, error, warning, and info messages in controllers and render them in your views.

View on GitHub
Deep Wiki
Context7

Flash Messages for Laravel

Frequently asked questions about Flash
How do I install caffeinated/flash in a Laravel application?
Run composer require caffeinated/flash, then register the service provider and Flash facade alias if your Laravel version does not auto-discover them. Publish the config and views if you need to customize the session key or alert markup, and add the package's render call to your base Blade layout. Because the last release targets Laravel 8, confirm Composer resolves against your app's framework version before installing.
Which Laravel and PHP versions does caffeinated/flash support?
The last release was March 2021 and targets Laravel 8. There is no documented evidence of support for Laravel 9, 10, or 11, so Composer may block installation on newer framework majors. Run a constraint check against your PHP and Laravel versions and be cautious about forcing version overrides in production.
What is the difference between caffeinated/flash and Laravel's native session flash?
It is a thin convenience layer over Laravel's native session flash data plus Blade rendering. Instead of juggling session()->flash('message', ...) calls, you get a fluent helper for success, error, warning, and info levels. Storage remains the session, so it is not a database, queue, or event-driven notification system.
Can I queue multiple flash messages at once with caffeinated/flash?
Yes. The package supports queuing multiple messages and Bootstrap-style alert levels, so you can flash several notifications in one request. It is not clearly documented as supporting separate named message bags, so assume a shared session key and avoid relying on per-tab or per-context isolation without verification.
Is caffeinated/flash safe from XSS when displaying messages?
Flash content is rendered into Blade views, so treat any ability to flash raw HTML as an XSS risk and verify exactly how the package's default template outputs messages. Use Blade's escaped double-brace syntax for user-supplied values and never pass unescaped input through raw output tags. If you need HTML in messages, sanitize it explicitly or restrict raw output to trusted strings.
How do I customize the Bootstrap alert markup in caffeinated/flash?
The package ships customizable templates, and the practical path is to publish its views or config and override the alert partial in your app. Review the default Bootstrap alert markup for accessibility, including role="alert" and aria-live, because default alerts may not announce correctly to screen readers. Keep the overridden partial in version control so upgrades do not silently change your UI.
Does caffeinated/flash work with Inertia, Livewire, or API-only Laravel apps?
No, it is designed for session-backed Blade rendering, not API-first, Inertia, or SPA-only architectures. In those stacks there is no server-rendered layout for the package's render call, so use your client-side toast or notification system instead. It may have limited relevance in a Blade-plus-Livewire app, but the package itself does not cross service boundaries.
Is caffeinated/flash still maintained or effectively abandoned?
The last release was March 2021, the project has roughly 43 stars, and it appears to be a single-maintainer package. Treat it as effectively unmaintained and plan to own or fork the code if you adopt it. Do not expect timely bug fixes or security patches.
Can I replace caffeinated/flash with a custom Blade component or helper?
A small custom Blade component or helper wrapping session()->flash() covers the same use case in roughly 40 lines and gives you full control over escaping, markup, and accessibility. Keep a fluent flash()->success() signature so call sites can survive a later swap away from the package. Other Laravel notification or toast packages are alternatives if you need richer behavior.
How do I test flash messages from caffeinated/flash in Laravel?
Because messages are stored in the session, you can assert them with Laravel's assertSessionHas after the request that flashes them. For rendered output, follow the redirect and assert the alert text appears in the response with assertSee. Also test your custom template for escaping and accessibility attributes if you override the defaults.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource