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