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