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