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