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.
2
Install the frontend adapter
Choose the adapter for your frontend framework:
3
Configure your frontend
Set up the toast components in your application.
- Vue 3
- React
Register the plugin in your Add the
resources/js/app.js:<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.
- Tailwind v4
- Tailwind v3
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:config/inertia-toast.php:
Frontend configuration
You can override the backend defaults when registering the plugin or provider:- Vue 3
- React
Next steps
Quickstart
Create your first toast notification
Server-side usage
Learn about the PHP API