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