Download the PHP package polashmahmud/inertia-toast without Composer
On this page you can find all versions of the php package polashmahmud/inertia-toast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download polashmahmud/inertia-toast
More information about polashmahmud/inertia-toast
Files in polashmahmud/inertia-toast
Package inertia-toast
Short Description Simple InertiaJS + Vue + Laravel toast notification system using vue-sonner.
License MIT
Informations about the package inertia-toast
Inertia Toast
Simple, zero-boilerplate toast notifications for Laravel + Inertia.js (Vue) using vue-sonner.
It ships with:
- Laravel middleware that exposes flash messages to Inertia
- A tiny Vue plugin that auto-mounts the Toaster and listens to Inertia navigations
- A publishable config to customize position, theme, and behavior
Installation
-
Install the package
-
Install the client dependency
- Add the plugin in your Vue app (auto-mounts Toaster)
resources/js/app.ts
You do NOT need to render <Toaster /> yourself—the plugin does it for you.
- Vite alias
vite.config.ts
Optionally, add a TypeScript path mapping for better editor DX in tsconfig.json:
- Publish the config
This creates config/inertia-toast.php where you can tweak:
Usage
From your controller or route, flash to the session. The plugin automatically shows a toast after the Inertia visit finishes.
Minimal (string body):
With description (indexed array):
With description (associative array):
Supported types: success, error, warning, info.
Custom Styling
You can customize the appearance of the toast notifications by modifying the toastOptions in config/inertia-toast.php.
Using Tailwind CSS
If you want to use Tailwind CSS classes in the class or descriptionClass options, you must ensure that Tailwind scans your configuration file. Add the config file path to the content array in your tailwind.config.js:
Troubleshooting
- Changed config but UI didn’t update?
- Run:
php artisan optimize:clear - Hard refresh the browser (Disable cache in DevTools)
- Ensure the provider is registered and alias resolves
- Run:
License
MIT