All options are viable, but following the KISS principle is generally the best approach. However, the decision depends on several factors, such as:
- The team size and their personal expertise
- Deployment constraints and budget considerations
- Whether you prioritize flexibility over simplicity
In your case, I would likely opt for a full Inertia setup with SSR capabilities, structured as follows:
- Public-facing site with SSR enabled
- Admin panel as a standard SPA
- Hotel manager dashboard as a standard SPA
You don’t need separate Inertia instances, just different layouts based on the route prefix:
<?php
// Public routes with SSR
Route::middleware(['inertia.ssr'])->group(function () {
Route::get('/', [HomeController::class, 'index'])->name('home');
...
});
// Admin routes
Route::prefix('admin')
->name('admin.')
->middleware(['auth:admin'])
->group(function () {
Route::get('/', [AdminDashboardController::class, 'index'])->name('dashboard');
// Admin resources
});
// Hotel manager routes
Route::prefix('hotel-manager')
->name('hotel.')
->middleware(['auth:hotel'])
->group(function () {
Route::get('/', [HotelDashboardController::class, 'index'])->name('dashboard');
// Hotel resources
});
Using this approach would give you:
- SEO for the public site (via SSR)
- Unified JS approach (Inertia throughout)
- Clear separation between the three "sections"
- Easy way to add functionality to each section