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; } }