jeremykenedy/laravel-toast
Powerful, highly configurable toast notifications for Laravel with 56 animations, 19 per-toast props, RTL support, dark mode, and full CSS/frontend framework parity across Tailwind, Bootstrap, Livewire, Vue, React, and Svelte.
v3.1.0 adds an optional notification settings page. People you authorize can change the color of every part of each notification type in light and dark mode, and every behavior option, from the browser with a live preview. Nothing changes for existing applications until they turn it on: it is off by default, creates no table, registers no routes, and toasts look exactly as before when no color is set.
colors config key.[@toastSettings](https://github.com/toastSettings) or [@include](https://github.com/include)('toast::settings')), Livewire (<livewire:toast-settings />), and Vue, React, and Svelte components. Blade and Livewire ship Tailwind v4, Bootstrap 5, and Bootstrap 4 views; the JavaScript components use framework-neutral CSS. Every UI previews light and dark toasts as you edit and covers all behavior options: position, direction, duration, maximum visible, opacity, enter and exit animations, progress bar placement, and the icon, border, close, progress, stack, pause, auto dismiss, and flash conversion switches.GET /toast/settings renders a published view that extends your own Blade layout and section, runs your own middleware, and sits behind a gate. toast:install and toast:update set it up.toast_settings table and merged over config/toast.php and .env. Anything never saved falls back to config.manage-toast-settings gate (name configurable) decides who can view and change settings. An undefined gate denies everyone. Colors are validated as hex before they are stored or written into CSS.toast:install and toast:update gain these flags. Without a flag, an interactive run asks whether to add the settings page. With --no-interaction, nothing about settings changes unless a flag is given. Options are validated before any file is written, and the commands never run migrations or define the gate.
| Flag | Description |
|---|---|
--settings |
Enable settings and publish the migration once |
--settings-page |
Also publish an editable page view and register the page route |
--settings-layout= |
Blade layout the page extends, for example layouts.app (the view must exist) |
--settings-section= |
Section the layout yields. Default content |
--settings-middleware= |
Comma separated route middleware. Default web,auth |
--settings-gate= |
Gate name. Default manage-toast-settings |
New publish tags: toast-settings-migrations and toast-settings-page. New routes, registered only when TOAST_SETTINGS_ENABLED=true: GET /toast/settings/data, PUT /toast/settings, DELETE /toast/settings, and GET /toast/settings when the page is enabled.
Supported source versions: v3.0.0 and v3.0.1 directly. From v2.0.0 or v1.0.0, follow the v3.0.0 upgrade steps first.
composer update jeremykenedy/laravel-toast
php artisan view:clear
Required steps: none. Requirements are unchanged (PHP 8.2+, Laravel 10 through 13, Livewire 3 or 4 when used).
data-toast-type, and the icon, progress track, and progress bar with data-toast-part. If you published toast-views, merge the new attributes into your copies, otherwise configured colors will not reach your markup. Styling is otherwise unchanged. Applications that never published views need nothing.npm run build if you import the Vue, React, or Svelte containers from vendor/. Colors arrive as colors_css on each toast payload (an empty string when no color is set) and are injected as one <style id="toast-colors"> tag. If you copied a component, import applyToastColors from toast-options.js and call it with toast.colors_css.php artisan toast:update --settings --settings-page --settings-layout=layouts.app
php artisan migrate
Review the published migration before running it. Then define who may use it:
Gate::define('manage-toast-settings', fn ($user) => $user->can('manage-site'));
Rollback: remove TOAST_SETTINGS_ENABLED from .env to return to config values (the saved row is kept), or run php artisan migrate:rollback --path=<published migration> to drop the table. Composer can pin v3.0.1 to go back to the previous release.
None to the public API, config keys, view names, published paths, or payload keys. One internal change: the install prompts' banner font (HasInstallPrompts::$font, a protected static property) is now the trait constant FONT. A class that used the trait and overrode or read $font must use FONT instead.
$casts property because Laravel 10 does not read the casts() method.toast:update and the install prompts were split into smaller methods with early returns. Behavior is unchanged.shivammathur/setup-php is pinned to a commit SHA in the workflow.docs/settings.md, and settings page screenshots for all three CSS frameworks.422.#rgb or #rrggbb and normalized before they are stored or emitted as CSS.[@source](https://github.com/source) line from the installation guide).Changes by @jeremykenedy in #13, #16, and #17.
Full Changelog: https://github.com/jeremykenedy/laravel-toast/compare/v0.5.0...v1.0.0
Full Changelog: https://github.com/jeremykenedy/laravel-toast/commits/v0.5.0
How can I help you explore Laravel packages today?