From de49b6ce28cfc81f47005c32efce25738689324f Mon Sep 17 00:00:00 2001 From: Mohammad Ibrahim <112249309+awesomecoderdev@users.noreply.github.com> Date: Fri, 17 Jul 2026 22:48:23 +0600 Subject: [PATCH] refactor: centralize route registration in bootstrap --- bootstrap/app.php | 10 +++++++--- routes/web.php | 5 +---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 2142c1e..47a94e8 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -15,8 +15,12 @@ return Application::configure(basePath: dirname(__DIR__)) ->withRouting( - web: __DIR__.'/../routes/web.php', - commands: __DIR__.'/../routes/console.php', + web: [ + base_path('routes/web.php'), + base_path('routes/settings.php'), + base_path('routes/install.php'), + ], + commands: base_path('routes/console.php'), health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { @@ -38,6 +42,6 @@ }) ->withExceptions(function (Exceptions $exceptions): void { $exceptions->shouldRenderJsonWhen( - fn (Request $request): bool => $request->is('api/*') || $request->expectsJson(), + fn(Request $request): bool => $request->is('api/*') || $request->expectsJson(), ); })->create(); diff --git a/routes/web.php b/routes/web.php index eda7662..f444a65 100644 --- a/routes/web.php +++ b/routes/web.php @@ -17,7 +17,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; -Route::get('/', fn (): RedirectResponse => redirect(auth()->check() ? '/dashboard' : '/login'))->name('home'); +Route::get('/', fn(): RedirectResponse => redirect(auth()->check() ? '/dashboard' : '/login'))->name('home'); Route::get('dashboard', function (Request $request) { $company = $request->user()->currentCompany ?? $request->user()->fallbackCompany(); @@ -72,6 +72,3 @@ Route::patch('categories/{category}/archive', [CategoryController::class, 'archive'])->name('categories.archive'); Route::delete('categories/{category}', [CategoryController::class, 'destroy'])->name('categories.destroy'); }); - -require __DIR__.'/settings.php'; -require __DIR__.'/install.php';