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