repository = $team; parent::__construct(); } /** * Show team's list. * * @param string $slug * * @return response */ protected function index() { $teams = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->setMetaTitle(trans('team::team.names')) ->view('team::public.team.index') ->data(compact('teams')) ->output(); } /** * Show team. * * @param string $slug * * @return response */ protected function show($slug) { $team = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($team->name . trans('team::team.name')) ->view('team::public.team.show') ->data(compact('team')) ->output(); } }