Files
root 943d5bfc38 feat: install and configure Inertia.js with React
- Install inertia-laravel, @inertiajs/react, react, @vitejs/plugin-react
- Add HandleInertiaRequests middleware registered in web group
- Create Inertia root template (resources/views/app.blade.php)
- Add React entry point and page components (resources/js/)
- Add Inertia demo route (/inertia-test)
- HomeController reverted to Blade (index page stays original)
- Remove inertia-test2 test route
2026-05-25 15:15:14 +02:00

68 lines
2.8 KiB
PHP
Executable File

<?php
use App\Http\Controllers\Auth\LoginRedirectController;
use App\Http\Controllers\Auth\LogoutController;
use App\Http\Controllers\Miscellaneous\HomeController;
use App\Http\Controllers\Miscellaneous\InstallationController;
use App\Http\Controllers\Miscellaneous\LocaleController;
use App\Http\Controllers\Miscellaneous\MaintenanceController;
use App\Http\Controllers\User\BannedController;
use Illuminate\Support\Facades\Route;
// Inertia demo route
Route::get('/inertia-test', function () {
return inertia('Home', [
'hotelName' => setting('hotel_name', 'Epicnabbo'),
]);
})->name('inertia.test');
// Radio embed (public, no auth required)
Route::get('/radio/embed', [\App\Http\Controllers\Radio\EmbedController::class, 'show'])->name('radio.embed');
// Language route
Route::get('/language/{locale}', LocaleController::class)->name('language.select');
// Installation routes
Route::prefix('installation')->controller(InstallationController::class)->group(function () {
Route::get('/', 'index')->name('installation.index');
Route::get('/step/{step}', 'showStep')->name('installation.show-step');
Route::post('/start-installation', 'storeInstallationKey')->name('installation.start-installation');
Route::post('/restart-installation', 'restartInstallation')->name('installation.restart');
Route::post('/previous-step', 'previousStep')->name('installation.previous-step');
Route::post('/save-step', 'saveStepSettings')->name('installation.save-step');
Route::post('/complete', 'completeInstallation')->name('installation.complete');
});
// All routes within this group is protected by maintenance, ban and 2FA middleware
Route::middleware(['maintenance', 'check.ban', 'force.staff.2fa'])->group(function () {
// Maintenance route
Route::get('/maintenance', MaintenanceController::class)->name('maintenance.show');
// Banned route
Route::get('/banned', BannedController::class)->name('banned.show');
// Home routes (guest only)
Route::middleware(['guest', 'throttle:60,1'])->withoutMiddleware('force.staff.2fa')->group(function () {
Route::get('/login', LoginRedirectController::class)->name('login');
Route::get('/', HomeController::class)->name('welcome');
Route::get('/home', HomeController::class)->name('home');
});
// Logout route
Route::post('/logout', LogoutController::class)->name('logout');
// Authenticated routes
Route::middleware('auth')->group(function () {
require __DIR__ . '/user.php';
require __DIR__ . '/community.php';
require __DIR__ . '/shop.php';
require __DIR__ . '/help-center.php';
require __DIR__ . '/client.php';
require __DIR__ . '/admin.php';
});
// Auth routes (mixed guest/auth)
require __DIR__ . '/auth.php';
});