withRouting( commands: __DIR__ . '/../routes/console.php', channels: __DIR__ . '/../routes/channels.php', health: '/up', ) ->withSchedule(function ($schedule): void { $schedule->job(DeleteOldResetTokens::class)->everyMinute(); $schedule->job(UpdateSlidesStatus::class)->everyMinute(); $schedule->job(SendReminderMail::class)->onOneServer()->dailyAt('10:00'); $schedule->job(SendMissingOrderReminderJob::class) ->onOneServer() ->hourly() ->when(function () { $schedulingService = app(PickupSchedulingService::class); $now = Date::now(); $currentCutoffAt = $schedulingService->currentCutoff(); $pickupReminderAt = $currentCutoffAt->copy() ->subDays(SendMissingOrderReminderJob::DAYS_BEFORE_CUTOFF) ->subHours(SendMissingOrderReminderJob::HOURS_BEFORE_CUTOFF); return $now->isSameHour($pickupReminderAt); }); $schedule->job(UpsertShopsPickupExceptionsUsingApiForYear::class) ->onOneServer() ->yearlyOn(11, 1, '7:30'); }) ->withMiddleware(require __DIR__ . '/middlewares.php') ->withExceptions(function (Exceptions $exceptions): void { $exceptions->reportable(function (\Throwable $e): void { if (app()->bound(HubInterface::class)) { resolve(HubInterface::class)->captureException($e); } }); GlobalHandler::afterAppBootstrap($exceptions); })->create();