2026-07-18 14:35:53 +03: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',
|
2026-07-18 15:12:44 +03:00
|
|
|
api: __DIR__.'/../routes/api.php',
|
2026-07-18 14:35:53 +03:00
|
|
|
commands: __DIR__.'/../routes/console.php',
|
|
|
|
|
health: '/up',
|
|
|
|
|
)
|
|
|
|
|
->withMiddleware(function (Middleware $middleware): void {
|
2026-07-21 19:23:23 +03:00
|
|
|
// 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: '*');
|
2026-07-18 14:35:53 +03:00
|
|
|
})
|
|
|
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
|
|
|
$exceptions->shouldRenderJsonWhen(
|
|
|
|
|
fn (Request $request) => $request->is('api/*'),
|
|
|
|
|
);
|
|
|
|
|
})->create();
|