attributes->get('lottery_player'); }); /** * 【当前请求语言】zh / en / ne,与 lottery.locales.supported 对齐。 * 由 NegotiateLotteryLocale 写入 attribute;控制台等非 HTTP 或无该中间件时回落到 fallback。 */ Request::macro('lotteryLocale', function (): string { /** @var Request $this */ return (string) ($this->attributes->get('lottery_locale') ?? config('lottery.locales.fallback', 'en')); }); } }