lotteryAdmin(); if (! $admin instanceof AdminUser) { return false; } $key = (string) $this->route('key', ''); return AdminSettingPolicy::canUpdate($admin, $key); } public function rules(): array { return [ 'value' => ['present'], ]; } public function after(): array { return [ function (): void { $key = (string) $this->route('key', ''); AdminSettingPolicy::validateItems([[ 'key' => $key, 'value' => $this->validated('value'), ]]); }, ]; } }