36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?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,
|
||
|
|
]);
|
||
|
|
|
||
|
|
// 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();
|