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