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