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