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