2026-06-27 14:38:18 +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',
|
|
|
|
|
commands: __DIR__.'/../routes/console.php',
|
|
|
|
|
health: '/up',
|
|
|
|
|
)
|
|
|
|
|
->withMiddleware(function (Middleware $middleware): void {
|
|
|
|
|
// Game middleware
|
|
|
|
|
$middleware->alias([
|
|
|
|
|
'verify.character' => \App\Http\Middleware\Game\VerifyCharacter::class,
|
|
|
|
|
'check.energy' => \App\Http\Middleware\Game\CheckEnergy::class,
|
|
|
|
|
'check.jail' => \App\Http\Middleware\Game\CheckInJail::class,
|
|
|
|
|
'check.hospital' => \App\Http\Middleware\Game\CheckInHospital::class,
|
2026-07-04 17:09:55 +03:00
|
|
|
'check.alive' => \App\Http\Middleware\Game\CheckAlive::class,
|
|
|
|
|
'check.cooldown' => \App\Http\Middleware\Game\CheckCooldown::class,
|
2026-06-27 14:38:18 +03:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// Game middleware group
|
|
|
|
|
$middleware->group('game', [
|
|
|
|
|
'auth',
|
|
|
|
|
'verify.character',
|
|
|
|
|
'check.jail',
|
|
|
|
|
'check.hospital',
|
|
|
|
|
]);
|
|
|
|
|
})
|
|
|
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
|
|
|
$exceptions->shouldRenderJsonWhen(
|
|
|
|
|
fn (Request $request) => $request->is('api/*'),
|
|
|
|
|
);
|
|
|
|
|
})->create();
|