/** * Run the command. */ public function handle() { $client = new Client(['key' => env('OAUTH2_CLIENT_ID'), 'name' => env('OAUTH2_CLIENT_NAME')]); // We need to manually generate the id for the client. $client->setId(ShortId::create()->generate()); // The secret is guarded, so set it manually here. $client->setAttribute('secret', env('OAUTH2_CLIENT_SECRET')); if ($client->save()) { $this->info('Client created.'); } else { $this->error('Could not save client'); } }