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