You save a post, Laravel redirects to the list, and the list looks exactly like before. Did it work? Give the reader a one-time “Saved.” toast with Inertia 3’s flash data, and skip the session key the starter kit never reads.
TL;DR
- Call
Inertia::flash('toast', ['type' => 'success', 'message' => 'Saved.'])before the redirect. - The kit’s
initializeFlashToast()already displays it. Don’t add another toast package. ->with('success', ...)writes Laravel’s session, which the kit’s toast doesn’t read.- Test it with
assertInertiaFlash('toast.message', 'Saved.').
The CRUD guide saves a post and redirects to the list. The list looks the same as it did before the save. The reader has no signal that the write worked.
Inertia 3 has a flash for that. It lives for the next response, then it is gone. The back button does not bring it back, because it is not stored in the history entry. A row in the notifications table is a different feature, the database bell. The stack is Laravel and Vue in 2026.
On the Vue starter kit#
The kit already listens. resources/js/app.ts calls initializeFlashToast(), and that function reads flash.toast and hands it to the toast that ships with the kit. Do not install another toast package. Do not register a second router.on('flash').
Flash this shape before the redirect the CRUD store method already returns:
Silent, then Shows the toast:
return to_route('posts.index')->with('success', 'Saved.');use Inertia\Inertia;
Inertia::flash('toast', [
'type' => 'success',
'message' => 'Saved.',
]);
return to_route('posts.index');type is success, info, warning, or error. The kit’s profile controller uses the same array when it updates the account. Match it. A plain string under another key will not reach that listener.
Gotcha: with() is a different flash
A with() call on that redirect writes Laravel’s session. The kit is not reading that key. The toast stays quiet.
A line in the layout#
Use this when the app does not call initializeFlashToast(). Flash a string and print it once. On the starter kit, prefer the toast array above so you do not show the same sentence twice.
Inertia::flash('success', 'Saved.');
return to_route('posts.index');<script setup lang="ts">
import { usePage } from "@inertiajs/vue3";
const page = usePage();
</script>
<template>
<p v-if="page.flash.success">{{ page.flash.success }}</p>
<slot />
</template>Tip: put it in the layout
Put that p in the layout that wraps the pages, not in one form. The next visit clears it. You do not delete it yourself.
A test#
assertInertiaFlash reads the flash on the redirect. It does not need the Vue page to render.
$this->post('/posts', [
'title' => 'Hello Laravel 13',
'excerpt' => 'A short excerpt.',
])->assertRedirect('/posts')
->assertInertiaFlash('toast.message', 'Saved.');A banner that flashes success asserts that key with the same method. The rest of the create test stays in the CRUD guide.
Run it
php artisan test --filter=PostTestRecap#
- Inertia flash data lives for one response and never comes back with the back button.
- On the starter kit, flash a
toastarray withtypeandmessage. ->with()writes Laravel’s session flash, a different channel.- Assert it with
assertInertiaFlash.
FAQ#
Why does my Laravel with() message not show in Vue?
The starter kit’s toast reads Inertia flash data (flash.toast), not the Laravel session key that with() writes. Use Inertia::flash() instead.
Does the flash message come back when I press the back button?
No. Inertia flash data is not stored in the history entry, so it only shows on the response that set it.
Which toast types does the starter kit support?
success, info, warning and error.
Next steps#
- Build a CRUD with Laravel, Inertia and Vue: the save this toast confirms.
- Database notifications in Vue: messages that persist.
- Keep the layout between Inertia visits: where the flash line lives.
- Inertia docs: flash data



