Example #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $clientName = $this->argument('name');
     $clientId = $this->option('id');
     $clientSecret = $this->option('secret');
     if (empty($clientId)) {
         $clientId = Str::random(40);
     }
     if (empty($clientSecret)) {
         $clientSecret = Str::random(40);
     }
     $oAuthClient = OauthClient::create(array('id' => $clientId, 'secret' => $clientSecret, 'name' => $clientName));
     if ($oAuthClient->exists) {
         $this->info('Client Name: ' . $clientName);
         $this->info('Client Id: ' . $clientId);
         $this->info('Client Secret: ' . $clientSecret);
         $this->info('Created');
     } else {
         $this->error('Client Name: ' . $clientName);
         $this->error('Failed');
     }
 }