empty($value) ? null : Crypt::decryptString($value), set: fn (?string $value) => empty($value) ? null : Crypt::encryptString($value), ); } public function couldBeEnabled(): bool { switch ($this->provider) { case 'azure': return filled($this->client_id) && filled($this->client_secret) && filled($this->tenant); case 'authentik': case 'clerk': return filled($this->client_id) && filled($this->client_secret) && filled($this->base_url); default: return filled($this->client_id) && filled($this->client_secret); } } }