input('current') ? $request->input('current') : 1; $pageSize = $request->input('pageSize') >= 10 ? $request->input('pageSize') : 10; $userModel = User::orderBy('created_at', 'DESC'); if ($request->input('email')) { $userModel->where('email', $request->input('email')); } $total = $userModel->count(); return response([ 'data' => $userModel->forPage($current, $pageSize) ->get(), 'total' => $total ]); } }