Skip to main content
This guide will help you create your first toast notification. We’ll cover both server-side (PHP) and client-side (Vue/React) usage.
Make sure you’ve completed the installation steps before continuing.

Server-side toast (from PHP)

The most common use case is showing a toast after a form submission or action in your Laravel controller.
1

Use the Toast facade in your controller

The toast will automatically appear on the next page after the redirect.
2

Try different toast types

Laravel Inertia Toast supports four types of toasts:
3

Add optional titles

You can add a title to provide more context:

Client-side toast (from Vue/React)

You can also trigger toasts from your frontend components using the useToast() composable/hook.
1

Import and use the composable

2

Add titles and custom duration

Pass an options object as the second argument:

Using the helper function

The toast() helper provides a fluent alternative to the facade:

Complete example

Here’s a complete example showing a form submission with validation and toast notifications:

Next steps

Now that you have your first toast working, explore more advanced features:

Server-side usage

Learn more about using the PHP API

Client-side usage

Explore Vue and React APIs

Configuration

Customize toast behavior and appearance

TypeScript support

Full type definitions and interfaces