/** * 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')); }
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)); }