repository = $kitchen; parent::__construct(); } /** * Show kitchen's list. * * @param string $slug * * @return response */ protected function index() { $kitchens = $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.names')) ->view('kitchen_blog::public.kitchen.index') ->data(compact('kitchens')) ->output(); } /** * Show kitchen. * * @param string $slug * * @return response */ protected function show($slug) { $kitchen = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->setMetaTitle($kitchen->name . trans('kitchen_blog::kitchen.name')) ->view('kitchen_blog::public.kitchen.show') ->data(compact('kitchen')) ->output(); } }