web/bootstrap/app.php

25 lines
910 B
PHP
Raw Permalink Normal View History

2026-08-22 23:42:57 +02:00
<?php
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 {
2026-08-23 21:58:27 +02:00
// The container is always behind a reverse proxy that terminates TLS;
// without this Laravel sees plain HTTP and generates http:// redirects
// onto an https:// page.
$middleware->trustProxies(at: '*');
2026-08-22 23:42:57 +02:00
})
->withExceptions(function (Exceptions $exceptions): void {
$exceptions->shouldRenderJsonWhen(
fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
);
})->create();