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