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