'boolean', ]; // ========================================================================= // 헬퍼 메서드 // ========================================================================= public static function getActiveTest(): ?self { return static::where('environment', 'test')->where('is_active', true)->first(); } public static function getActiveProduction(): ?self { return static::where('environment', 'production')->where('is_active', true)->first(); } public static function getActive(bool $isTestMode): ?self { return $isTestMode ? static::getActiveTest() : static::getActiveProduction(); } public function getEnvironmentLabelAttribute(): string { return $this->environment === 'test' ? '테스트' : '운영'; } public function getMaskedCertKeyAttribute(): string { $key = $this->cert_key; if (strlen($key) <= 8) { return str_repeat('*', strlen($key)); } return substr($key, 0, 4).'****'.substr($key, -4); } }