1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-10 07:06:45 +02:00

feat(tokens): update class, add generateID method #566

This commit is contained in:
Awilum
2021-08-07 18:03:52 +03:00
parent 580f618ce1
commit 4339f66a59

View File

@@ -17,18 +17,8 @@ class Tokens extends Entries
{
use Macroable;
public function create(string $id, array $data = []): bool
public function generateID(): string
{
throw new Exception('Use generate method instead');
return false;
}
public function generate(array $data = []): string
{
$id = strings()->random()->toString();
parent::create($id, $data);
return $id;
return bin2hex(random_bytes(16));
}
}