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