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