search; $pageLimit = $request->input('pageLimit', config('database.pagination.limit')); $page = InstagramCampaign::pushScope(new RequestScope()) ->pushScope(new InstagramCampaignPublicScope()) ->select('instagram_campaigns.*') ->paginate($pageLimit) ->withQueryString(); $data = new InstagramCampaignsCollection($page); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle(trans('instagram::instagram_campaign.names')) ->view('instagram::public.instagram_campaign.index') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } /** * Show instagram_campaign. * * @param string $slug * * @return response */ protected function show(PublicRequest $request, $slug) { $model = InstagramCampaign::findBySlug($slug); $data = new InstagramCampaignResource($model); $categories = []; $tags = []; $recent = []; return $this->response->setMetaTitle($data['title'] . trans('instagram::instagram_campaign.name')) ->view('instagram::public.instagram_campaign.show') ->data(compact('data', 'categories', 'tags', 'recent')) ->output(); } }