Files
laraundfelix/bootstrap/app.php
T
LarsandCursor 2035c46edd
Deploy Test / test (push) Successful in 2m25s
Deploy Test / deploy (push) Failing after 25s
Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 08:32:14 +01:00

38 lines
1.3 KiB
PHP

<?php
use App\Http\Middleware\UseStaffSessionCookie;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Request;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*');
$middleware->prepend(UseStaffSessionCookie::class);
$middleware->redirectGuestsTo(function (Request $request) {
if ($request->is('verwaltung', 'verwaltung/*')) {
return '/verwaltung/login';
}
return '/anmelden';
});
$middleware->redirectUsersTo(function (Request $request) {
if ($request->is('verwaltung', 'verwaltung/*')) {
return '/verwaltung';
}
return '/bereich';
});
})
->withExceptions(function (Exceptions $exceptions): void {
$exceptions->shouldRenderJsonWhen(
fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
);
})->create();