| Server IP : 14.225.216.240 / Your IP : 216.73.216.26 Web Server : nginx/1.20.1 System : Linux localhost.localdomain 5.14.0-596.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 27 16:02:33 UTC 2025 x86_64 User : taidh ( 1001) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/pts/bootstrap/ |
Upload File : |
<?php
//phpcs:ignore
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\TrustProxies;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance;
use Illuminate\Http\Middleware\ValidatePostSize;
use Illuminate\Foundation\Http\Middleware\TrimStrings;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Auth\AuthenticationException;
use App\Middleware\Authenticate as AppAuthenticate;
use App\Middleware\ForcePassword;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__ . '/../routes/web.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(
function (Middleware $middleware) {
$middleware->use(
[
TrustProxies::class,
HandleCors::class,
PreventRequestsDuringMaintenance::class,
ValidatePostSize::class,
TrimStrings::class,
ConvertEmptyStringsToNull::class,
]
);
$middleware->alias(
[
'auth.verified' => AppAuthenticate::class,
'auth.forcePassword' => ForcePassword::class,
'guest' => \App\Middleware\RedirectIfAuthenticated::class,
'signed' => \App\Middleware\ValidateSignature::class,
]
);
$middleware->group(
'auth',
['auth.verified', 'auth.forcePassword']
);
}
)
->withMiddleware(
function (Middleware $middleware) {
$middleware->validateCsrfTokens(
except: [
// Exclude all routes starting with 'api/'
'api/*',
// Exclude a specific URL
// HTTP_PROTOCOL . 'api.' . DOMAIN . SERVER_PORT . '/*',
]
);
}
)
->withExceptions(
function (Exceptions $exception) {
$loginURL = config('domain.web.url') . '/auth/login';
if ($exception instanceof TokenMismatchException) {
return redirect()->to($loginURL);
}
if ($exception instanceof AuthenticationException) {
return redirect()->to($loginURL);
}
}
)->create();