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