Blog
Laravel Livewire vs Inertia vs API + React: How to Choose
Laravel Livewire, Inertia, or a separate API plus React: where HTML is rendered, which skills you need, and how SEO, Sanctum, and deploys differ.
Muhammad Zubair Akhtar
Laravel Livewire is the PHP way to build a reactive screen inside a Laravel app: a component class or a single-file Blade component, public state on the server, and a small request that re-renders that component when someone clicks. The other two shapes people put next to it are Inertia, where Laravel still owns the route and hands props to a React, Vue, or Svelte page, and a separate API plus React or Next.js, where Laravel returns JSON and another app draws the screen. This page is how I choose among those three. It is a fit question, not a ranking.
I am Zubair Akhtar, a senior software engineer in Lahore, Pakistan. I ship Laravel applications, including the screen in front of them. If you want that choice made against a real repository, the work sits under Laravel development.
Figure 1. Livewire's first response is HTML from PHP. Inertia's first response is props, plus HTML only when the SSR process is running. An API plus React draws the page in a second app.
Versions this was written against
On 16 November 2026 I read the Livewire 4.x quickstart, the Livewire 3.x quickstart, and the Livewire 3.x testing page. I read Laravel's starter kits page, Inertia's server-side setup, Inertia's testing page, the Inertia v2 server-side rendering page, and the Inertia v2 deferred props page. I also read the Packagist page for livewire/livewire and the Packagist page for inertiajs/inertia-laravel.
Packagist listed livewire/livewire v4.4.8, published 21 October 2026, and v3.8.11 on the same day. The 3.x docs page says you are browsing an old version. Both quickstarts require Laravel 10 or later and PHP 8.1 or later, and both print composer require livewire/livewire with no version constraint. That command installs the current release. On the day I read Packagist, the current release was v4.
Packagist listed inertiajs/inertia-laravel v3.7.0, published 2 November 2026, requiring PHP ^8.2 and Laravel ^11.35, ^12.0, or ^13.0. The 2.x tags on that page run through v2.0.28. The v2 docs pages I opened warn that Inertia v3 is the default now.
Laravel's starter kits page says the React kit is Inertia 3, React 19, Tailwind 4, and shadcn/ui. The Vue kit is Inertia 3 and the Vue 3 Composition API. The Svelte kit is Inertia 3 and Svelte 5. The Livewire kit is Livewire 4, Tailwind, and Flux UI. All four use Laravel Fortify for login, registration, password reset, and email verification. I have not run these snippets for this article.
| Piece | What the page said on 16 November 2026 |
|---|---|
| Livewire, current release | v4.4.8, published 21 October 2026 |
| Livewire 3.x | v3.8.11 the same day. The 3.x docs call themselves an old version |
| Livewire starter kit | Livewire 4, Tailwind, Flux UI, Fortify |
inertia-laravel | v3.7.0, published 2 November 2026. PHP ^8.2. Laravel ^11.35, ^12, or ^13 |
| Inertia 2.x | Tags through v2.0.28. The v2 docs say v3 is the default |
| React, Vue, and Svelte starter kits | Inertia 3 |
A new app in November 2026 should start from those starter kits, which means Livewire 4 or Inertia 3. The v3 and v2 shapes below are the ones an existing app is still likely to have, and the 3.x and v2 pages still document them. I label each snippet with the page it came from. Copying a v3 route into a v4 app, or a v2 root template into an Inertia 3 app, is the mistake the version table is there to prevent.
How Laravel Livewire works
Livewire keeps the UI state on the server. A public property is the value. A public method is the action. The browser sends a request, Livewire runs the method, re-renders the component, and updates the DOM. The 4.x quickstart describes that as writing the interface in PHP, with Livewire handling the JavaScript.
The 3.x quickstart generates two files, app/Livewire/Counter.php and resources/views/livewire/counter.blade.php, with php artisan make:livewire counter. This is that page's class, shortened only by leaving the decrement method out:
namespace App\Livewire;
use Livewire\Component;
class Counter extends Component
{
public $count = 1;
public function increment()
{
$this->count++;
}
public function render()
{
return view('livewire.counter');
}
}
The view on that page is a single root element. Both quickstarts say a component must have one root element, and that a second root or a comment outside it throws.
<div>
<h1>{{ $count }}</h1>
<button wire:click="increment">+</button>
</div>
The 3.x page registers the page with the class itself:
use App\Livewire\Counter;
Route::get('/counter', Counter::class);
The 3.x layout command writes resources/views/components/layouts/app.blade.php. That page says Livewire 3 and above injects its own front-end assets, so the layout it prints has no script tag.
What Livewire 4 changes in the starter kit
The 4.x quickstart is a different file layout. php artisan make:livewire pages::post.create writes a single-file component at resources/views/pages/post/⚡create.blade.php. The PHP class is an anonymous class at the top of the Blade file. The same page registers the route like this:
Route::livewire('/post/create', 'pages::post.create');
The 4.x layout command writes resources/views/layouts/app.blade.php, and the file it prints includes @vite, @livewireStyles, and @livewireScripts. The 4.x docs also add pages the 3.x nav does not list, including Islands. I have not read the Islands page for this article, so I am not describing how an island is marked up. The point for a decision is narrower: a v3 class-and-view pair and a v4 single-file page are the same product, with a different generator. The team skill is still PHP and Blade.
wire:navigate is in the directive list on both the 3.x and 4.x docs. It is how a Livewire app does page-to-page navigation without a full browser reload. It does not move rendering into a JavaScript framework. The first response for a full-page component is still the layout plus the rendered Blade.
I would reach for Laravel Livewire when the people who will maintain the screens write PHP, the screens are forms, tables, filters, and wizards, and a round trip to the server on each action is acceptable. A staff panel of Eloquent resources is often Laravel Filament rather than a component you write by hand. Filament renders that panel with Livewire. Picking Filament is picking Livewire for that part of the app.
How Laravel Inertia works
Inertia is the protocol between a Laravel controller and a JavaScript page component. It is not a component library, and it is not an API you design. The server-side setup page says you return a page name and props. The client resolves that name to a React, Vue, or Svelte file and renders it. Routing, auth, and validation stay in Laravel.
The current server-side setup page installs the adapter with composer require inertiajs/inertia-laravel, publishes middleware with php artisan inertia:middleware, and appends HandleInertiaRequests to the web middleware group in bootstrap/app.php. The root template it prints is this document, which mounts the JavaScript app on <x-inertia::app />:
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
@vite('resources/js/app.js')
<x-inertia::head />
</head>
<body>
<x-inertia::app />
</body>
</html>
The same page says that prior to v3 the root template used @inertiaHead and @inertia. Those directives are still supported. They do not offer the SSR head fallback the Blade components do. An app that is still on the v2 adapter should expect the directives. A new starter kit should expect the components. I would not mix a hand-written @inertia div with <x-inertia::app /> in the same layout.
The response shape on that page, which the v2 deferred-props page also uses, is:
use Inertia\Inertia;
return Inertia::render('Event/Show', [
'event' => $event->only(
'id',
'title',
'start_date',
'description',
),
]);
The page component lives under resources/js in the starter kits. The React kit's pages are in resources/js/pages. There is no second repository and no JSON contract to version, because the props are the contract and they are allowed to change with the page. The server-side setup page's warning still applies: everything you put in that array is visible in the browser. Omit the columns you would not put in a public JSON response.
The v2 deferred-props page shows slow data loaded after the first paint:
'permissions' => Inertia::defer(fn () => Permission::all()),
That page warns that v3 is now the default. I would re-read the current props page before pasting Inertia::defer into an Inertia 3 starter kit. The current testing page still documents deferred props, including loadDeferredProps, so the idea is still in the product. The method signature is the part I am not treating as stable across the major bump.
React, Vue, or Svelte, still one Laravel app
The starter kits page is explicit that Inertia uses classic server-side routing and controllers. A visit is a Laravel route. A form post is a Laravel route that redirects back to an Inertia response. You do not stand up /api/v1 to paint a settings screen. You do write JavaScript components, a Vite build, and a package.json that moves on the React or Vue release schedule.
I would reach for Laravel Inertia when the screen is a product interface, the people building it want React, Vue, or Svelte, and you still want one repository, one set of routes, and Laravel's session auth. A separate frontend team that deploys on its own calendar is a sign you have outgrown this shape. So is a second client, such as a phone app, that needs the same data. Inertia does not stop you adding an API. It stops you from pretending the page props are that API.
When the UI is an API plus React
The third option splits the system. Laravel exposes JSON. A React SPA, or a Next.js app, fetches it and owns the screen, the routing, and usually its own deploy. This is the right shape when the website is one client among several, or when the frontend is a product with its own team and its own release.
The contract is then yours to keep. Resource names, status codes, validation errors, and a version in the path are the work in REST API development with Laravel. I am not repeating that checklist here. The decision this page adds is whether you need that contract for the screen at all. A Livewire page and an Inertia page do not need it. A React app on another origin does.
Next.js is the variant I mean when the public pages have to be HTML and the app is already a separate frontend. Next can render a marketing page on its own server and call Laravel for the account data. That is two systems. It is justified when the marketing site and the product UI have different release needs, or when the same JSON must feed a phone app and the site. It is a costly default for an internal tool whose only client is a browser.
A phone app does not, by itself, force this split for the website. The phone needs a token API. The website can stay Livewire or Inertia, and the API can sit beside it in routes/api.php. I would only move the website onto that API when the website is genuinely another client, with its own routing and its own deploy.
Team skills
The stack you pick is the stack you have to hire for two years from now.
A Livewire app is a Laravel app. The reviewer reads PHP, Blade, policies, and a Vite file for CSS. The Laravel hiring checklist covers that review. You do not need a React specialist to ship a form.
An Inertia app needs both. The controller, the policy, and the validation are PHP. The page is React, Vue, or Svelte, plus TypeScript in the current starter kits. One person who already works across that boundary is the situation in what a full stack developer does. A team that is split, and that wants the frontend to move without a PHP review, will feel the single repository as a bottleneck. That feeling is useful. It is the signal to look at a separate frontend, not a reason to start there.
An API plus React needs the PHP review and a frontend review, and it needs someone who owns the contract between them. If that someone does not exist, the two apps drift. I would not pick the split so that a hiring plan looks modern. I would pick it when the clients are actually plural.
Interactivity
Every Livewire action in the quickstarts is a server round trip. wire:click and wire:submit call a PHP method. wire:model on the 4.x form example sends the value when the form is submitted, not on each keystroke. The 4.x page points at its validation docs for real-time checks. Alpine, which both doc sets list, is how you keep a small interaction in the browser: a disclosure, a local toggle, a field that should not wait on PHP.
That round trip is a good trade for a CRUD screen, a filterable table, a multi-step form, and a wizard that must enforce rules the server already owns. It is a poor trade for a canvas, a drag-and-drop board with dozens of updates a second, an offline screen, or a page whose state is mostly in the browser. Those screens want a component that can update without a PHP request.
Inertia gives you that component. A click that only changes local state stays in React or Vue. A click that changes a record is an Inertia visit: a Laravel request, a redirect, and a new set of props. You are not writing an endpoint per widget. You are also not free of the network. You have moved the chatty updates to the client and kept the durable ones on the server.
An API plus React gives you the same client, and it makes every durable update an endpoint you designed. That is what you want when a phone app will send the same update. It is extra surface when the only caller is the page you just wrote.
SEO and the first response
Search engines read the HTML of the first response. What that HTML contains is the practical difference.
A Livewire full-page component renders Blade on the server. The words of the page are in the document before any Livewire request runs. Later interactions morph the DOM. A public article, a marketing page, or a catalog row that is rendered this way is HTML a crawler can fetch without executing the component runtime. I am not claiming a ranking from that. I am saying the words are in the response.
Inertia without the SSR process does not do that. The root template is HTML. The page component is rendered in the browser from the props. The v2 server-side rendering page describes SSR as the way visitors receive fully rendered HTML, and it says that makes the site easier for search engines to index. The same page says the SSR server is a Node process, with Bun available through php artisan inertia:start-ssr --runtime=bun. The starter kits page builds that bundle with npm run build:ssr. Locally, composer dev:ssr starts the Laravel server and the SSR server together.
If the pages have to be indexed and you will not keep that process running, I would not pick Inertia for those pages. Livewire already returns the HTML. Next.js returns it from its own server, which is the API-plus-React variant, and it brings the second deploy with it. An authenticated app behind a login has a weaker version of this problem: there is little public HTML to index, so the SSR process is a performance and a no-JavaScript concern rather than an SEO one. The v2 page says that with the SSR server running you can disable JavaScript and still navigate. That is the claim I would re-check on the current SSR page before I promised it for an Inertia 3 app.
Auth, and where Sanctum fits
The starter kits do not use Sanctum to sign a person into a Livewire or Inertia screen. They use Fortify, on the web middleware group, with a session cookie and CSRF. HandleInertiaRequests can share the authenticated user with every page. A Livewire component reads the same auth user any Blade view reads. Adding Sanctum because "the app has a frontend" confuses the UI protocol with an API.
Sanctum belongs on the JSON routes. The REST API post is the longer version, written against the Laravel 13 Sanctum docs. The short version, for this choice:
- A Livewire or Inertia UI keeps the session. You do not issue a personal access token for it.
- A first-party React SPA on the same registrable domain can use Sanctum's cookie mode: stateful API domains, a CSRF cookie, and
Accept: application/json. The API post covers why an SPA on another registrable domain cannot use that cookie. - A mobile app, or a third party, uses a bearer token. Sanctum issues it. Passport is the alternative when you are the OAuth server. Those tokens are justified by the other client, not by the website framework.
The mix I recommend most often is the session UI plus a small token API. The website stays Livewire or Inertia. The phone posts email, password, and a device name to an issuing route, then sends Authorization: Bearer. The website and the phone do not have to share a frontend.
Testing
Each shape has a server-side test that does not boot a browser. That test is the one I want on the path that writes a record.
The 3.x testing page generates tests/Feature/Livewire/CreatePostTest.php with php artisan make:livewire create-post --test. The assertions it documents include assertStatus, assertSee, set, assertSet, call, and assertHasErrors. This chain is the validation example on that page, without the class wrapped around it:
Livewire::test(CreatePost::class)
->set('title', '')
->call('save')
->assertHasErrors('title');
That test runs the PHP component. It does not prove the browser morph worked. It does prove the action rejected an empty title. I have not checked whether the 4.x testing page still addresses a single-file component by class name. A v4 page component may need the name the generator gave it. Read the 4.x testing page before you copy the class form into a Livewire 4 app.
Inertia's testing page tests the response, not the React render. The example uses assertInertia to check the component name and the props:
use Inertia\Testing\AssertableInertia as Assert;
$this->get('/podcasts/41')
->assertInertia(fn (Assert $page) => $page
->component('Podcasts/Show')
->has('podcast')
);
The same page says to set INERTIA_SSR_ENABLED to false in phpunit.xml when you do not want the test suite calling the SSR server, or to call Inertia::disableSsr() from the test base class. A component test in Vitest or an end-to-end run in Cypress is a second suite. The page names both. I would add that suite when the page has client behavior the props test cannot see. I would not add it as a substitute for assertInertia on the controller.
An API plus React splits the tests the way it splits the apps. The JSON contract gets a Laravel feature test, which the API post shows with Sanctum::actingAs. The screen gets a frontend test in the other repository. Both have to move when the payload changes. That double update is part of the cost of the split, and it is worth it when two clients share the payload.
Hosting and the deploy shape
A Livewire app deploys as one Laravel app. PHP-FPM, nginx, a release directory, and a queue worker if you send mail or import files in the background. That layout is Deploy Laravel to a VPS. The UI choice does not change it. The 3.x quickstart injects Livewire's assets for you. The 4.x layout also runs your CSS and JS through Vite, so the release has to include the built assets. Neither quickstart asks for a Node process in production.
An Inertia app without SSR is the same shape plus a Vite build. Node runs in CI or on the build machine. It does not run on the server. npm run build has to have happened before the release is swapped, or the browser gets a page with no component runtime.
An Inertia app with SSR adds a long-running process: php artisan inertia:start-ssr, after npm run build:ssr. The v2 page says Node has to be available for that. I would supervise it the way a queue worker is supervised, and I would treat a dead SSR process as a failed release, because the HTML you added SSR to get is the HTML that process produces. I have not reproduced a downed SSR process for this article, and I am not guessing the fallback. Background jobs stay on the queue either way. Horizon, timeouts, and failed jobs are Laravel queues and Horizon, and they do not change because the screen is React.
An API plus Next.js is two deploys. The Laravel half can still be the VPS release above. Next.js is its own Node server, or a host that runs Next, with its own environment and its own rollback. CORS, the cookie domain, and which origin is allowed to call the API become part of the release checklist. A static React build is simpler than Next and still a second artifact. I would write down which of the two apps can ship alone before I called the split an architecture.
What you maintain afterwards
Livewire maintenance is Composer, a Livewire upgrade, and the Blade you wrote. The jump from the 3.x generator to the 4.x generator is a real upgrade, which is why I would start a new app on the Livewire 4 starter kit rather than on the 3.x quickstart. An app that is already on v3.8 can stay while v3 is maintained. Packagist still published a 3.x release on 21 October 2026. I would not start a new project on a docs section that calls itself old.
Inertia maintenance is Composer and npm. React 19, the Inertia client, and Tailwind move on their own. The adapter major, from the v2 directives to the v3 Blade components, is the upgrade I would schedule on purpose rather than discover in a layout. One repository keeps the deploy simple and couples the two upgrades: a PHP release and a JS release are the same release.
An API plus a separate frontend maintains both of those, plus the contract. Versioning, CORS, token expiry, and two CI pipelines are ongoing work. That work pays for itself when a mobile app or a partner is actually calling the API. It is overhead when the only consumer is the React app one person also wrote.
A staff admin on top of any of these is a separate decision. If the admin is forms and tables on Eloquent models, Filament is the Livewire panel I would reach for before I built a second Inertia admin. The boundary is the one in the Filament post: a product UI with its own design system is Inertia or React, and a panel of resources is Filament.
A decision table
Walk the rows from the top. The first row that is true is the one I would write down before anyone installs a package. "Stay" beats every row when that stack is already in production and it is not the thing that is failing.
| Situation | Choice |
|---|---|
| PHP and Blade team, screens are forms, tables, filters, and wizards | Laravel Livewire. On a new app, the Livewire 4 starter kit |
| Staff editing Eloquent models, and the UI can look like a panel | Filament, which is Livewire, rather than a page you design from scratch |
| React, Vue, or Svelte, one Laravel repo, session auth, no second client | Laravel Inertia. The current starter kits are Inertia 3 |
| Public pages must be HTML in the first response, and you will not run Node in production | Livewire, or Inertia only if SSR is an accepted process |
| Public pages must be HTML, and a separate frontend already owns them | Next.js in front of a Laravel API |
| A mobile app or a third party needs the same records | A Sanctum or Passport API beside the UI. This row does not replace the UI row |
| The website is one of several clients, with its own team or its own deploy | API plus React or Next.js |
| One of the three is already shipping and is not the problem | Stay. Add an API beside it if a new client appears |
A decision checklist
A blank line means stop, or fill the line in before installing Livewire, Inertia, or Sanctum.
- Name the clients. A browser, a browser plus a phone, or a third party. Write the list down.
- If a phone or a third party is on the list, sketch the JSON boundary first. Keep the website on Livewire or Inertia unless the website is itself just another client of that JSON.
- Name who writes the screens for the next year. PHP points at Livewire. React, Vue, or Svelte in this repository points at Inertia. A separate frontend team points at a separate app.
- Name the interactivity. A server round trip per action fits forms and tables. A canvas, offline use, or a design system you already have in React fits Inertia or the separate app.
- Name the public URLs that have to ship their text in the first response. Livewire does that in PHP. Inertia does it with
inertia:start-ssrkept running. A client-rendered shell does not. - Name the auth. Fortify and a session for a Livewire or Inertia starter kit. Sanctum cookies only for a same-site SPA. Bearer tokens for a phone or another domain. Passport only if you are the OAuth server.
- Name the deploy. One PHP release, one PHP release plus an SSR process, or two apps. The VPS guide is the PHP half.
- Name the tests.
Livewire::teston the action,assertInertiaon the page props, or a feature test on the JSON plus a frontend suite. - Name the person who will run the Composer and npm upgrades. When that name exists, the next step is a scoped build under Laravel development. The questions to ask any developer, including me, are in the hiring checklist.
Figure 2. Four questions, in order. A phone app adds an API. It does not throw away the website UI. A separate React app is the last box, for when the website is one client among several.
FAQ
What is Laravel Livewire?
Laravel Livewire is a UI layer inside a Laravel app. You write PHP and Blade. Livewire sends a request when an action runs and re-renders the component. On 16 November 2026 the current Packagist release was v4.4.8, and the Livewire starter kit was Livewire 4 with Flux UI. v3.8.11 was still published that October. The 3.x docs call themselves an old version.
What is Laravel Inertia?
Laravel Inertia is the Laravel adapter for Inertia. A controller returns Inertia::render with the page name and the props. React, Vue, or Svelte renders the page in the same repository. It is not a JSON API. On 2 November 2026 Packagist listed inertiajs/inertia-laravel v3.7.0, and Laravel's React, Vue, and Svelte starter kits were Inertia 3.
Do I need Sanctum for Livewire or Inertia?
Not for the screen. The starter kits sign people in with Fortify and a session cookie. Sanctum is for JSON clients: a same-site SPA using the cookie flow, or a phone and a third party using bearer tokens. Those routes can live beside a Livewire or Inertia UI. The shape of that API is the REST API guide.
Which one is better for SEO?
The one whose first response contains the words of the page. Livewire renders Blade on the server. Inertia renders the page to HTML when the SSR process is running, and otherwise sends a root template plus props. A separate Next.js app can render its own HTML and call Laravel for data. I am not offering a ranking outcome. I am describing what the first response is made of.
Can I use Livewire and a React API together?
Yes. The combination I would actually ship is a Livewire or Inertia website, a Filament panel if the staff UI is forms and tables, and a Sanctum API if a phone or a partner needs the records. Three frontends that all render the same screen is a different choice, and I would not make it so that each framework gets a turn.
Should a new app start on Livewire 3?
No. On 16 November 2026 I would use the Livewire starter kit, which the Laravel docs describe as Livewire 4. I would stay on v3 only in an app that is already on the 3.x line and whose upgrade is not the task. The 3.x quickstart is still the right page for reading a class component that already exists.
If you want the choice made on a real app
I am a senior software engineer in Lahore. The useful starting point is the client list, who will write the screens, and whether any public URL has to ship HTML on the first response.
If those answers are written down, the build is Laravel development. I start from the route and the auth, then the first screen. I have not described a client project here, and I have not run the commands above against an application.
