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