search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = Campaign::pushScope(new RequestScope()) ->pushScope(new CampaignPublicScope()) ->paginate($pageLimit) ->withQueryString(); $campaigns = new CampaignsCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('social::campaign.names')) ->view('social::public.campaign.index') ->data(compact('campaigns', 'categories', 'tags', 'recent')) ->output(); } /** * Show campaign. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = Campaign::findBySlug($slug); $data = new CampaignResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('social::campaign.name')) ->view('social::public.campaign.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }