Skip to main content
You can trigger toast notifications from your Laravel controllers, routes, or any backend code using either the Toast facade or the toast() helper function.

Using the facade

The Toast facade provides static methods for each toast type:

Method signatures

Each toast method accepts the following parameters:

Using the helper

The toast() helper provides two usage patterns:

Fluent builder pattern

When called with a message, it returns a PendingToast instance that allows you to chain configuration methods:

Direct toaster access

When called without arguments, it returns the Toaster instance for direct method calls:

Toast types

Laravel Inertia Toast supports four toast types:
Use for successful operations:

Adding a title

You can add an optional title to provide context for your toast messages.

With the facade

Use named arguments to specify the title:

With the helper

Chain the title() method:

Custom duration

By default, toasts auto-dismiss after the duration specified in your config (5000ms). You can override this per toast.
Duration is specified in milliseconds. For example, 3000 = 3 seconds.

With the facade

With the helper

Chain the duration() method:

Combining title and duration

You can combine both title and duration options:

With the facade

With the helper

Multiple toasts

You can queue multiple toasts in a single request. They will be displayed according to your max_visible configuration:

Working with redirects

Toasts work seamlessly with redirects because they’re flashed to the session via Inertia:
Toasts persist across redirects, so you can trigger them before returning a redirect response.

Common patterns

Here are some common usage patterns:

API reference

PendingToast methods

The PendingToast class (returned by toast('message')) provides these chainable methods:
  • title(string $title): static - Set the toast title
  • duration(int $milliseconds): static - Set custom duration in milliseconds
  • success(): Toaster - Commit as a success toast
  • error(): Toaster - Commit as an error toast
  • info(): Toaster - Commit as an info toast
  • warning(): Toaster - Commit as a warning toast

Toaster methods

The Toaster class (accessed via Toast facade or toast() without arguments) provides:
  • success(string $message, ?string $title = null, ?int $duration = null): Toaster
  • error(string $message, ?string $title = null, ?int $duration = null): Toaster
  • info(string $message, ?string $title = null, ?int $duration = null): Toaster
  • warning(string $message, ?string $title = null, ?int $duration = null): Toaster
  • add(string $message, ToastLevel $level, ?string $title = null, ?int $duration = null): Toaster
  • hasPending(): bool - Check if there are pending toasts
  • getPropKey(): string - Get the Inertia flash key