public function __construct() { parent::__construct(); $permissions = Cache::get('admin.perm.list'); if (!$this->isLoggedIn || !$this->user->ability(null, $permissions['scoreboard'])) { throw new AccessDeniedHttpException(); } $id = Input::get('server_id'); if (!is_numeric($id) || !filter_var($id, FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]])) { throw new NotFoundHttpException('Invalid Server ID'); } try { $this->server = Server::findOrFail($id); } catch (ModelNotFoundException $e) { throw new NotFoundHttpException(sprintf('No server found with id of %s.', $id)); } $this->repository = App::make('BFACP\\Repositories\\Scoreboard\\LiveServerRepository', [$this->server])->attempt(); if (Input::has('players')) { $this->players = array_map('trim', explode(',', Input::get('players'))); } }
public function __construct(BanRepository $repo) { parent::__construct(); $this->repository = $repo; }
public function __construct(Metabans $metabans) { parent::__construct(); $this->metabans = $metabans; }
public function __construct(PlayerRepository $repository) { parent::__construct(); $this->repository = $repository; }
public function __construct(Chat $chat, Server $server) { parent::__construct(); $this->chat = $chat; $this->server = $server; }