/**
  * Show the dashboard
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function getIndex()
 {
     pagetitle([trans('main.dashboard'), settings('server_name')]);
     $online_players = 0;
     foreach (DB::connection('account')->table('worlds')->get() as $world) {
         $online_players += $world->online_user;
     }
     $releases = $this->github->api('repo')->releases()->all('huludini', 'aura-kingdom-web');
     return view('admin.index', compact('online_players', 'releases'));
 }
Exemplo n.º 2
0
 public function handle(GitHubManager $gm)
 {
     $searchParams = sprintf('user:%s repo:%s state:open in:title %s', $this->user, $this->repo, $this->title);
     $search = $gm->api('search')->issues($searchParams, 'created', 'desc');
     if ($search['total_count'] == 0) {
         $createParams = ['title' => $this->title, 'body' => $this->body];
         if (count($this->labels) > 0) {
             $createParams['labels'] = $this->labels;
         }
         $gm->issue()->create($this->user, $this->repo, $createParams);
     }
 }
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(GitHubManager $github)
 {
     $github->authenticate($this->user->token, 'http_token');
     $issues = [];
     foreach ($this->milestones as $milestone) {
         $i = explode('/', $milestone);
         $milestone = $github->api('issue')->all($i[0], $i[1], ['milestone' => $i[2], 'state' => 'all']);
         foreach ($milestone as $issue) {
             $issues[] = $i[0] . '/' . $i[1] . '/' . $issue['number'];
         }
     }
     $this->dispatch(new AddIssuesHandler($issues, $this->user));
 }
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(GitHubManager $github)
 {
     $github->authenticate($this->user->token, 'http_token');
     $issues = new Collection();
     foreach ($this->issues as $issue) {
         $i = explode('/', $issue);
         $issues->push((object) $github->issues()->show($i[0], $i[1], $i[2]));
     }
     if ($report = Report::findByUser($this->user)) {
         $report->issues = array_merge($report->issues, $issues);
     } else {
         $report = new Report(['user_id' => $this->user->id, 'issues' => $issues->sortByDesc('number')]);
     }
     return $report->save();
 }
Exemplo n.º 5
0
 public function __call($name, $arguments)
 {
     return call_user_func_array([$this->github->repo()->contents(), $name], array_merge([$this->owner, $this->repository], $arguments));
 }
 /**
  * @return mixed
  */
 private function getRepoDetails()
 {
     return $this->github->connection('alternative')->repos()->show(self::GITHUB_HANDLE, self::REPO_NAME);
 }
Exemplo n.º 7
0
 /**
  * Get the config instance.
  *
  * @return \Illuminate\Contracts\Config\Repository 
  * @static 
  */
 public static function getConfig()
 {
     //Method inherited from \GrahamCampbell\Manager\AbstractManager
     return \GrahamCampbell\GitHub\GitHubManager::getConfig();
 }