polashmahmud/inertia-toast
Larablocks Analysis
polashmahmud/inertia-toast works with any PHP project: the latest release (v2.0.1, Dec 1, 2025) doesn't depend on Laravel.
Recommendation checks
Use with careUse with care: meets 0 of 3 checks.
- No release in the last 12 months (last: Dec 1, 2025)
- 0 downloads a month (needs 10,000)
- 2 GitHub stars (needs 100)
State
Quiet- Last stable release: Dec 1, 2025.
- No releases in the last 12 months.
- First released: Oct 28, 2025.
- 2 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require polashmahmud/inertia-toast |
|
| Latest Version: | v2.0.1 |
| License: | MIT |
| Last Updated: | Dec 1, 2025 |
| Links: | GitHub · Packagist |
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
composer require polashmahmud/inertia-toast:^2.0.1
- Install the client dependency
npm install vue-sonner
- Add the plugin in your Vue app (auto-mounts Toaster)
resources/js/app.ts
import "vue-sonner/style.css";
import notification from "@inertia-toast/plugins";
createInertiaApp({
// ...
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.use(notification)
.mount(el);
},
});
You do NOT need to render <Toaster /> yourself—the plugin does it for you.
- Vite alias
vite.config.ts
import path from "path";
export default defineConfig({
resolve: {
alias: {
"@inertia-toast": path.resolve(
__dirname,
"vendor/polashmahmud/inertia-toast/resources/js"
),
},
},
});
Optionally, add a TypeScript path mapping for better editor DX in tsconfig.json:
{
"compilerOptions": {
"paths": {
"@inertia-toast/*": ["./vendor/polashmahmud/inertia-toast/resources/js/*"]
}
}
}
- Publish the config
php artisan vendor:publish --tag="inertia-toast-config"
This creates config/inertia-toast.php where you can tweak:
return [
'position' => 'bottom-right', // top-left | top-center | top-right | bottom-left | bottom-center | bottom-right
'closeButton' => true,
'expand' => false,
'theme' => 'system', // light | dark | system
'richColors' => true,
'toastOptions' => [
'style' => [],
'class' => '',
'descriptionClass' => '',
],
];
Usage
From your controller or route, flash to the session. The plugin automatically shows a toast after the Inertia visit finishes.
Minimal (string body):
return back()->with('success', 'That worked nicely');
With description (indexed array):
return back()->with('warning', ['That worked nicely', 'Please check again']);
With description (associative array):
return back()->with('error', [
'message' => 'Something went wrong!',
'description' => 'Please try again after 5 seconds.',
]);
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.
'toastOptions' => [
'style' => [
'background' => '#fda4af',
],
'class' => 'bg-red-500 text-white',
'descriptionClass' => 'text-red-100',
],
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:
module.exports = {
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
"./resources/**/*.vue",
"./config/inertia-toast.php", // Add this line
],
// ...
};
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
Alternatives to polashmahmud/inertia-toast
Backend and frontend utilities for common Inertia.js + Laravel patterns. Type-sa...
Define Laravel forms in PHP and render them with Inertia.js in Vue, React, or Sv...
Complete notification system with toast messages, colors, icons, and actions. Di...
Version History
| Version | Released | License |
|---|---|---|
| v2.0.1 | MIT | |
| v2.0.0 | MIT | |
| v1.0.1 | MIT | |
| v1.0.0 | MIT |