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