/** * Retrieve a user by the given credentials. * * @param array $credentials * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByCredentials(array $credentials) { $isAccess = $this->acl->getAccessControl($credentials['name']); if ($isAccess) { $user = $this->user->getAuthenticateUser($credentials['id']); if (!$user) { $user = $this->user->addUser($credentials); } if (!is_null($user)) { return new GithubUser((array) $user); } } }
/** * Execute the console command. * @return void */ public function fire() { $accountName = $this->input->getArgument('account'); try { $data = $this->github->getGithubUser($accountName); if (isset($data['id'])) { $this->acl->setAccessControl($accountName); $this->info("added : {$accountName}"); } } catch (\GuzzleHttp\Exception\ClientException $e) { $this->error("{$accountName} Not Found"); } catch (\Illuminate\Database\QueryException $e) { $this->info("{$accountName} has already been added"); } }