What the HELL#%!& is Laravel Inertia for?
Content Index
This is a question I've been asking myself for months and that I want to share with you, including a little context about my projects and experiences.
Context
The projects I usually work on typically have two parts:
- Administrative: control panel, dashboard, CRUD, internal management.
- End-user: blogs, product sales, courses, books, reservations, etc.
This applies to any topic: selling cars, tickets, caps, renting houses or hotels... there's always an administrative part and another part visible to the end-user.
SPA and SEO: a complicated relationship
A significant problem with SPAs (Single Page Applications) is that they don't always rank well in search engines. Google, for example, loads dynamic content in chunks and often doesn't "read" the information correctly, which makes SEO difficult.
That's why, for web pages we want to rank (hotels, products, blogs), the classic approach is still more recommendable.
Inertia: Vue instead of Blade
The main feature of Inertia is that it returns a Vue component instead of a Blade. For example:
public function create()
{
$categories = Category::get();
return inertia("dashboard/post/Save", compact('categories'));
}That's practically 90% of what Inertia offers. Unlike Livewire, it doesn't provide direct interaction with the backend using component events or methods.
For example, in Livewire we can have a button that executes a component method directly:
<x-button class="flex-shrink-0" wire:click="tagSave">
{{ __('Set') }}
</x-button>And call component methods directly:
public function tagSave()
{
// dd($this->tags[$this->tag_selected]);
if ($this->tag_selected != null) {
$t = Tag::find($this->tag_selected);
$this->tagsSelected[$t->id] = $t->title;
if ($this->post)
$this->post->tags()->sync(array_keys($this->tagsSelected));
}
}Inertia for dashboards: not the best option
For administrative modules, such as a dashboard, I wouldn't recommend Inertia.
- Vue/Inertia is more intended for the end-user, where animations, interactivity, and visual experience are key.
- The backend is usually more functional and simple: less style, fewer animations, more efficiency.
In contrast, Livewire is more efficient for dashboards:
- Everything is still Blade/Laravel.
- Component methods are called directly without the need for additional routes or Axios requests.
- Better scalability and modularization for CRUD operations and complex actions in the dashboard.
Rest API + Laravel: the ideal option nowadays
Today, all web applications have their mobile equivalent: Udemy, Duolingo, Gmail, etc.
If I had used Inertia for my academy website, I would have had a significant problem:
- To create the mobile app in Flutter, I would need to duplicate every Inertia controller to generate the Rest API.
- Every change on the web would have to be replicated in the mobile API.
- This generates redundancy and complications in the application logic.
That's why the best practice is:
- Laravel + Rest API (robust and reusable backend).
- Vue/React/Flutter (web or mobile frontend).
- Livewire only for dashboards where fast interaction is needed without duplicating logic.
✅ Conclusion
- Inertia is useful if you want to replace Blade with Vue and maintain a web project that is quick to develop.
- It is not ideal for administrative dashboards or when you plan mobile applications that consume the same logic.
- For scalable and cross-platform projects: Laravel + Rest API + separate frontend (Vue, React, Flutter) is the most recommendable combination.
- Livewire is still excellent for dashboards and CRUD operations where direct integration with Blade/Laravel is an advantage.
I agree to receive announcements of interest about this Blog.
I don't know why Laravel Inertia is used, what do you use it for?