|null $value */ public function set(Model $model, string $key, mixed $value, array $attributes): string { if (is_array($value)) { $value = EpisodeMetadata::fromArray($value); } return $value?->toJson() ?? json_encode([]); } }