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