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