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