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('$restaurant::review.names')) ->view('restaurant::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('restaurant::review.name')) ->view('restaurant::review.show') ->data(compact('review')) ->output(); } }