withRouting( using: function () { if (config('auth.expose_api')) { Route::middleware('api') ->prefix('api') ->name('api.') ->group(base_path('routes/api.php')); } Route::middleware([ VerifyInstallation::class, 'web', ])->group(base_path('routes/web.php')); }, commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { $middleware->alias([ 'auth' => Authenticate::class, 'bindings' => SubstituteBindings::class, 'registration' => RegistrationEnabled::class, 'social.login' => SocialLogin::class, 'role' => CheckRole::class, 'permission' => CheckPermissions::class, 'session.database' => DatabaseSession::class, 'two-factor' => TwoFactorEnabled::class, 'verify-2fa-code' => VerifyTwoFactorCode::class, 'password-reset' => PasswordResetEnabled::class, 'banned' => CheckIfBanned::class, 'approved' => EnsureUserIsApproved::class, 'password-change' => ForcePasswordChange::class, ]); // DemoMode is last so that a refusal is the final word on a request // that got this far. It has to stay after SubstituteBindings, which // the group already runs first, because its rules read the route bound // user, role and permission models. $middleware->web([ SetLocale::class, 'banned', HandleInertiaRequests::class, DemoMode::class, ]); $middleware->api([ UseApiGuard::class, EnsureFrontendRequestsAreStateful::class, 'throttle:60,1', 'banned', DemoMode::class, ]); }) ->withExceptions(function (Exceptions $exceptions): void { // })->create();