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

Laravel Toast Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v3.1.0

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.

Major changes

  • Color pickers for every part of every notification. Success, error, warning, and info toasts each have separate light and dark colors for the background, text, border, icon, progress bar, and progress track. A part left on Default keeps the CSS framework's own color. Colors can also be set without the UI through the new colors config key.
  • A settings UI for every frontend and CSS framework. Blade ([@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.
  • An optional full page that lives in your application. 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.
  • Saved settings override config. Values are stored in an opt-in toast_settings table and merged over config/toast.php and .env. Anything never saved falls back to config.
  • Authorization is closed by default. The 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.

Commands

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.

Upgrade guide

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).

  1. Merge published view changes. Every renderer now marks toasts with 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.
  2. Rebuild frontend assets with 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.
  3. Optional, to use the settings page:
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.

Breaking changes

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.

Minor changes and fixes

  • Compatibility fix found in review: saved settings use the $casts property because Laravel 10 does not read the casts() method.
  • Setting a text color also recolors the Bootstrap close button, which Bootstrap otherwise draws in a fixed color that disappears on light custom backgrounds.
  • toast:update and the install prompts were split into smaller methods with early returns. Behavior is unchanged.
  • The React container's progress, style, and exit-animation logic moved into helpers. Behavior is unchanged.
  • shivammathur/setup-php is pinned to a commit SHA in the workflow.
  • Added PHPCS, PHPMD, ESLint, Stylelint, markdownlint, and Codacy configuration aligned with Pint and StyleCI.
  • README, CHANGELOG, docs/settings.md, and settings page screenshots for all three CSS frameworks.

Security

  • The feature is disabled by default and gated; an undefined gate denies everyone.
  • Updates go through a form request that authorizes with the gate and rejects unknown keys and invalid values with 422.
  • Colors are accepted only as #rgb or #rrggbb and normalized before they are stored or emitted as CSS.
  • Published routes run your middleware list before the gate.

Verification

  • 413 PHP tests (774 assertions), 78 frontend tests, and 11 Chromium tests pass. The PHP and JavaScript color generators are checked against one shared fixture.
  • CI on the merged commit passes: PHP 8.2 through 8.5 with Laravel 10 through 13 and Livewire 3 and 4, installation without Livewire, Pint, Composer validation, framework isolation, and frontend behavior. StyleCI passes.
  • Codacy reports grade A with zero issues, down from about 1,200 findings before this release.
  • Driven in a real browser in a Laravel application: Blade and Livewire under Tailwind, Bootstrap 5, and Bootstrap 4; Tailwind dark mode; and the Vue, React, and Svelte components (load, live preview, save, per-color Default, reset), with real toasts recolored after saving.

Known limitations

  • The settings panel strings ship in English. Other locales fall back to English until translated.
  • The standalone settings page, used when no layout is configured, loads Tailwind or Bootstrap from a public CDN. Set a layout for production.
  • The Vue, React, and Svelte components use framework-neutral CSS rather than each CSS framework's classes, and their Reset button does not ask for confirmation.
  • Tailwind previews need your build to include the package views (the existing [@source](https://github.com/source) line from the installation guide).

Documentation

Changes by @jeremykenedy in #13, #16, and #17.

Full changelog: v3.0.1 to v3.1.0

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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo