1
0
forked from metin2/web
web/bootstrap/app.php

35 lines
1.1 KiB
PHP
Raw Normal View History

2023-07-23 01:14:14 +03:00
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Symfony\Component\HttpFoundation\Request;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(at: [
'10.0.0.0/8',
'172.16.0.0/12',
'192.168.0.0/16',
]);
})
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(headers: Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB
);
})
2025-01-01 13:39:02 +02:00
->withMiddleware(function (Middleware $middleware) {
$middleware->appendToGroup('web', \App\Http\Middleware\Language::class);
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();