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