Files
lotteryLaravel/bootstrap/app.php

26 lines
946 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
// 自动加前缀 `api` + middleware `api`,见 routes/api.php
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->alias([
// 玩家端需登录路由使用;解析 Bearer → Player
'lottery.player' => \App\Http\Middleware\EnsurePlayerApi::class,
// 后台 API 预留Sanctum / RBAC
'lottery.admin' => \App\Http\Middleware\EnsureAdminApi::class,
]);
})
->withExceptions(function (Exceptions $exceptions): void {
//
})->create();