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