withRouting( web: __DIR__.'/../routes/web.php', api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { // 为 API 路由添加 CSRF 豁免 $middleware->validateCsrfTokens(except: [ 'api/jira/*', 'api/env/*', 'api/message-sync/*', 'api/message-dispatch/*' ]); }) ->withExceptions(function (Exceptions $exceptions): void { // }) ->withSchedule(function (Schedule $schedule): void { $schedule->command('git-monitor:check') ->everyTenMinutes() ->withoutOverlapping() ->runInBackground(); $schedule->command('git-monitor:cache') ->dailyAt('02:00') ->withoutOverlapping(); }) ->create();