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('$group::group.names')) ->view('group::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('group::group.name')) ->view('group::group.show') ->data(compact('group')) ->output(); } }