A free open source IT asset/license management system
Changed siganture to be clearer
snipea711e608c9ab
diff --git a/app/Console/Commands/GeneratePersonalAccessToken.php b/app/Console/Commands/GeneratePersonalAccessToken.phpindex d5c94d29ee..7179cfeb89 100644--- a/app/Console/Commands/GeneratePersonalAccessToken.php+++ b/app/Console/Commands/GeneratePersonalAccessToken.php@@ -17,7 +17,7 @@ class GeneratePersonalAccessToken extends Command* @var string*/protected $signature = 'snipeit:make-api-key- {user : The ID of the user to create the token for}+ {--user_id= : The ID of the user to create the token for.}{--name= : The name of the new API token}{--key-only : Only return the value of the API key}';@@ -62,11 +62,11 @@ class GeneratePersonalAccessToken extends Command$accessTokenName = 'CLI Auth Token';}- if ($this->argument('user')=='') {- return false;+ if ($this->option('user_id')=='') {+ return $this->error('ERROR: user_id cannot be blank.');}- if ($user = User::find($this->argument('user'))) {+ if ($user = User::find($this->option('user_id'))) {if ($this->option('key-only')) {$this->info($user->createToken($accessTokenName)->accessToken);