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