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