From 4339f66a59ac641a1dfee84a1b9724c70c770b87 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 7 Aug 2021 18:03:52 +0300 Subject: [PATCH] feat(tokens): update class, add `generateID` method #566 --- src/flextype/Tokens/Tokens.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/flextype/Tokens/Tokens.php b/src/flextype/Tokens/Tokens.php index 42d110ca..e2b86073 100644 --- a/src/flextype/Tokens/Tokens.php +++ b/src/flextype/Tokens/Tokens.php @@ -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)); } } \ No newline at end of file