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