$value */ public function set(Model $model, string $key, mixed $value, array $attributes): string { if (is_array($value)) { $value = CategoryCollection::fromArray($value); } return $value->toJson(); } }