SmartPlaylistRuleGroupCollection::create(json_decode($value, true))) : null; } public function set($model, string $key, $value, array $attributes): ?string { if (is_array($value)) { $value = SmartPlaylistRuleGroupCollection::create($value); } return $value?->toJson() ?? null; } }