/** * @return Repo[] */ public function index() { if ($this->user()->admin) { return Repo::query()->ordered()->get(); } else { return $this->user()->repos; } }
/** * @return Repo */ public function repo() { return Repo::query()->where('id', $this->get('repo_id'))->first(); }