Skip to main content
Laravel Inertia Toast consists of three packages: a PHP backend package and two frontend adapters (Vue 3 and React). You need to install the PHP package and the adapter for your frontend framework.

Installation

1

Install the PHP package

Install the Laravel package via Composer:
The service provider and facade are automatically registered via Laravel’s package discovery.
Optionally, publish the configuration file:
This creates a config/inertia-toast.php file where you can customize default settings.
2

Install the frontend adapter

Choose the adapter for your frontend framework:
3

Configure your frontend

Set up the toast components in your application.
Register the plugin in your resources/js/app.js:
Add the <Toasts /> component to your main layout file:
4

Configure Tailwind CSS

Since the toast components use Tailwind classes internally, you need to add the package to Tailwind’s source detection so the required classes are generated.
Add the following @source directive to your main CSS file (e.g., resources/css/app.css):
The relative path above assumes your CSS file is at resources/css/app.css. Adjust accordingly if your setup differs.

Configuration options

Both the PHP backend and frontend adapters support configuration options:

PHP configuration

Publish the config file to customize default settings:
This creates config/inertia-toast.php:

Frontend configuration

You can override the backend defaults when registering the plugin or provider:
If you change prop_key in the PHP config, make sure to update propKey in your frontend configuration to match.

Next steps

Quickstart

Create your first toast notification

Server-side usage

Learn about the PHP API