*/ public const SENSITIVE_KEY_PATTERNS = ['_key', '_secret', '_password']; /** * @var list */ protected $fillable = [ 'group', 'key', 'value', 'type', 'label', 'order_index', 'is_public', ]; /** * @return array */ protected function casts(): array { return [ 'group' => SettingGroup::class, 'type' => SettingType::class, 'is_public' => 'boolean', 'order_index' => 'integer', ]; } public function isSensitive(): bool { foreach (self::SENSITIVE_KEY_PATTERNS as $pattern) { if (str_contains($this->key, $pattern)) { return true; } } return false; } }