Laravel-first API
Use `toast()` or `InertiaToast` and let the package pass the message to Inertia for you.
Simple toast messages and confirm dialogs for your Laravel Inertia app.
Laravel Inertia Toast connects Laravel flash messages to an Inertia-powered Vue 3 UI without extra wiring in every page.
It is built for apps that want:
web middleware groupFlash toast payloads from controllers with a single toast() call.
Share toast data automatically through the web middleware group and render it on visits.
Use typed plugin options, positions, modal options, and composables in Vue 3 projects.
Handle delete and danger flows with a promise-based confirm dialog that fits Inertia actions.
Coming soon. The current release is built for Laravel + Inertia + Vue 3.
toast() helper for Laravel redirects and post-action feedbackInertiaToast::flash() facade access when you want to inspect the resolved payloadsuccess, error, warning, and info toast typestop-left to bottom-rightThis package aims for low configuration, not zero dependencies.
>= 8.110, 11, 12, or 13inertiajs/inertia-laravel ^1.3, ^2.0, or ^3.03@inertiajs/core ^2.0 or ^3.0@inertiajs/vue3 ^2.0 or ^3.0public function store()
{
// Persist your record...
toast('Post created successfully', 'success', 'Saved');
return redirect()->route('posts.index');
}import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/vue3';
import ToastPlugin from '@erag/inertia-toast';
import '@erag/inertia-toast/dist/style.css';
createInertiaApp({
resolve: (name) => {
const pages = import.meta.glob('./Pages/**/*.vue', { eager: true });
return pages[`./Pages/${name}.vue`];
},
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.use(ToastPlugin, {
position: 'bottom-right',
})
.mount(el);
},
});<script setup lang="ts">
import { useConfirmation } from '@erag/inertia-toast';
import { router } from '@inertiajs/vue3';
const { confirm } = useConfirmation();
const destroyPost = async (id: number) => {
const accepted = await confirm({
title: 'Delete post',
message: 'This action cannot be undone.',
type: 'danger',
confirmText: 'Delete',
});
if (!accepted) {
return;
}
router.delete(route('posts.destroy', id));
};
</script>toast payload into the session.props.toast.Want to contribute to the package?