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