Files
muninn/bootstrap/app.php
T

27 lines
1.0 KiB
PHP
Raw Normal View History

<?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',
2026-07-18 15:12:44 +03:00
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
// Behind a reverse proxy (nginx serves plain HTTP on :8001; TLS is
// terminated in front of it), so trust X-Forwarded-* headers —
// otherwise Laravel/Livewire generate http:// URLs even when the
// original request was https, tripping mixed-content blocking.
$middleware->trustProxies(at: '*');
})
->withExceptions(function (Exceptions $exceptions): void {
$exceptions->shouldRenderJsonWhen(
fn (Request $request) => $request->is('api/*'),
);
})->create();