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