Download the PHP package shufflingpixels/laravel-toast without Composer
On this page you can find all versions of the php package shufflingpixels/laravel-toast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shufflingpixels/laravel-toast
More information about shufflingpixels/laravel-toast
Files in shufflingpixels/laravel-toast
Package laravel-toast
Short Description Lightweight toast backend with session flash support for Laravel
License AGPL-3.0-or-later
Informations about the package laravel-toast
Laravel Toast
Lightweight toast backend with session flash support for Laravel.
It lets you create, collect, and flash toast messages on the backend, while leaving full control over how you render them on the frontend. Pair it with your preferred UI, or use our suggested Livewire/Tailwind frontend.
Frontends
shufflingpixels/laravel-toast-flux(Livewire Flux + Tailwind + Alpine).
Requirements
- PHP 8.1+
- Laravel 10+ (or
illuminate/support>= 10)
Installation
The service provider and facade alias are auto-discovered. You can use the facade Toast immediately.
Concepts
- Message: a typed object with
severity,text, optionaldetails, andduration(ms). - Manager: collects messages during a request and can flash a single message across redirects via session.
- Severities:
info,success,warning,error.
Quick Start
Createa toast message in a controller action:
In your Blade view, pull messages and render them however you like:
or use one of the frontent packages
Flash Across Redirects
To show a toast on the next request (after redirect), flash the message:
On the subsequent request, call Toast::getMessages() in your layout or view; flashed messages are merged into the in-memory collection and cleared from the session automatically.
Helper Function
This package provides a global toast() helper that returns the manager. If you pass a severity and text, it will create the message immediately.
Helper signature:
API Reference
Facade:
Message object:
Severities enum:
Blade Stubs (Optional)
The package ships minimal Blade stubs you can copy and adapt:
src/stubs/container.blade.php– loops overToast::getMessages()and renders each message via a component.src/stubs/message.blade.php– minimal message markup.
Feel free to inline the logic in your layout or create your own Blade components.
Notes
- Default duration is
3000ms; use it to control how long a toast should stay visible on the frontend. - Flashed messages are stored under the session key
shufflingpixels.toast.flashand are cleared when read viagetMessages(). - This package does not include any JavaScript; you own the presentation and dismissal logic.