This commit is contained in:
2023-10-17 18:56:37 +03:00
parent d9736b29a4
commit 4b9e9cb4f6
13 changed files with 4 additions and 432 deletions
-38
View File
@@ -1,38 +0,0 @@
<?php
namespace Lucent\Primitive;
use Illuminate\Support\Collection;
/**
* @extends \Illuminate\Support\Collection<int|string, string>
*/
final class StringCollection extends Collection
{
public function __construct(
string ...$array
) {
parent::__construct($array);
}
/**
* @return string[]
**/
public function toArray(): array
{
return collect($this)->values()->toArray();
}
public static function fromArray(array $data): StringCollection
{
return new StringCollection(...$data);
}
public static function fromDB(string $data): StringCollection
{
return new StringCollection(...\json_decode($data,true));
}
}