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
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 theuseToast() composable/hook.
- Vue 3
- React
1
Import and use the composable
2
Add titles and custom duration
Pass an options object as the second argument:
Using the helper function
Thetoast() helper provides a fluent alternative to the facade:
Complete example
Here’s a complete example showing a form submission with validation and toast notifications:- Controller (PHP)
- Component (Vue)
- Component (React)
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