'boolean', ]; /** * 테스트 서버 설정 조회 (환경 기준, is_active 무관) */ public static function getActiveTest(): ?self { return self::where('environment', 'test')->first(); } /** * 운영 서버 설정 조회 (환경 기준, is_active 무관) */ public static function getActiveProduction(): ?self { return self::where('environment', 'production')->first(); } /** * 현재 환경에 맞는 설정 조회 * * 테넌트별 서버 모드 지원을 위해 is_active 조건 제거 */ public static function getActive(bool $isTestMode = false): ?self { return $isTestMode ? self::getActiveTest() : self::getActiveProduction(); } /** * 환경 라벨 */ public function getEnvironmentLabelAttribute(): string { return match ($this->environment) { 'test' => '테스트서버', 'production' => '운영서버', default => $this->environment, }; } /** * 상태 라벨 */ public function getStatusLabelAttribute(): string { return $this->is_active ? '활성' : '비활성'; } /** * 상태 색상 (Tailwind) */ public function getStatusColorAttribute(): string { return $this->is_active ? 'green' : 'gray'; } /** * 마스킹된 인증키 (앞 8자리만 표시) */ public function getMaskedCertKeyAttribute(): string { if (strlen($this->cert_key) <= 8) { return $this->cert_key; } return substr($this->cert_key, 0, 8).str_repeat('*', 8).'...'; } }