From bcd74ff09bd81bb924931231ae9697425e65116a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 21 Jul 2018 17:14:15 +0930 Subject: [PATCH] Fix API key generation --- framework/core/src/Api/ApiKey.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framework/core/src/Api/ApiKey.php b/framework/core/src/Api/ApiKey.php index ffd8d591c..e8ebb48ec 100644 --- a/framework/core/src/Api/ApiKey.php +++ b/framework/core/src/Api/ApiKey.php @@ -31,8 +31,10 @@ class ApiKey extends AbstractModel */ public static function generate() { - return new static([ - 'id' => str_random(40) - ]); + $key = new static; + + $key->key = str_random(40); + + return $key; } }