Inertia.js added support for Flash Data, which sends one-time data to your frontend that shouldn't reappear as users navigate through the browser history. Flash data in Inertia.js works much like flash data in Laravel's HTTP Sessions, which removes it after the subsequent request.
On the backend, here's a Laravel example of rendering a view and defining flash data:
Inertia::render('Projects/Index', [ 'projects' => $projects,])->flash('highlight', $project->id); // Or flash data and redirect backInertia::flash('newUserId', $user->id)->back();
On the frontend, you can access flash data via the page object:
<script setup>import { usePage } from '@inertiajs/vue3' const page = usePage()</script> <template> <div v-if="page.flash.toast" class="toast"> {{ page.flash.toast.message }} </div></template>
See the documentation for full details on Flash Data in Inertia.js.
Release Notes
You can see the complete list of new features and updates below and the diff between 2.3.2 and 2.3.3 on GitHub. The following release notes are directly from the changelog:
v2.3.3
- Add support for protocol-relative urls in url.ts by @machour in https://github.com/inertiajs/inertia/pull/2769
- Fix brackets notation qs parsing by @skryukov in https://github.com/inertiajs/inertia/pull/2722
- Support for Flash Data by @pascalbaljet in https://github.com/inertiajs/inertia/pull/2757