getHex()->toString()); else $new[] = Uuid::fromString($id)->getHex()->toString(); } return collect($new); } /** * @param Collection|array $collection * @return Collection|UuidInterface[] */ public static function convertFromHexToUuidCollecton(Collection|array $collection, bool $toString = false): Collection { $new = []; foreach ($collection as $id) { if($toString) $new[] = Uuid::fromHexadecimal(new Hexadecimal($id))->toString(); else $new[] = Uuid::fromHexadecimal(new Hexadecimal($id)); } return collect($new); } }