How do I migrate from Inertia 2 to Inertia 3 beta in a Laravel app?

Answered by 2 creators across 2 videos

Migrating from Inertia 2 to Inertia 3 beta in a Laravel app is largely about embracing the new Vite-based setup, built-in HTTP handling, and the redesigned upgrade path. As Laravel Daily explains, Inertia 3 no longer ships Axios and uses the built-in HTTP client, with a new inertia-vite setup that shortens initialization and replaces the old createInertiaApp pattern. The beta also removes the need for a separate SSR server because SSR runs automatically during development via a new Vite plugin, simplifying local setup and eliminating a separate server process. Optimistic updates are now first-class across the router, useForm, and useHTTP, so the UI updates immediately while the server action completes (with rollback if needed). Finally, you’ll want to adopt the new layout props and the updated exception handling approach, where you can supply a custom view.js component or behavior via a callback rather than relying on legacy event buses. For the upgrade itself, follow the concrete commands: install the new Laravel package (composer require inertia/laravel v3) and refresh your front-end stack (npm install for Vue and Vite) as described in the official upgrade notes, then switch to inertia-vite and adopt the new config-first initialization pattern rather than createInertiaApp. In practice, you’ll also start using the useHTTP hook for non-navigation requests and the new layout props to pass data to layouts, and you’ll test the changes with the beta’s improved exception handling flow to verify your app behaves as expected during the transition.

  • Laravel Daily points out that Axios is removed and the built-in HTTP client (useHTTP) handles requests, reducing dependencies and boilerplate.
  • Laravel News notes the upgrade commands you must run (composer require inertia/laravel v3 and npm install for Vue/Vite) and highlights the optional built-in XHR client plus the new useHTTP hook for non-navigation requests.
  • Laravel Daily highlights that Inertia 3 replaces createInertiaApp with inertia-vite and a shorter setup via new config patterns, and emphasizes automatic SSR during npm run dev, removing the need for a separate SSR server.