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