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