改进 分页: 携带查询字符串

This commit is contained in:
iVampireSP.com 2022-12-18 18:11:06 +08:00
parent db0642d594
commit 2a07a3c045
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
3 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,7 @@ public function index(Request $request): View
}
}
$hosts = $hosts->paginate(100);
$hosts = $hosts->paginate(100)->withQueryString();;
return view('admin.hosts.index', compact('hosts'));
}

View File

@ -38,7 +38,7 @@ public function index(Request $request): View
$users = $users->where('email', 'like', '%' . $request->email . '%');
}
$users = $users->with('user_group')->paginate(100);
$users = $users->with('user_group')->paginate(100)->withQueryString();;
return view('admin.users.index', compact('users'));
}

View File

@ -22,6 +22,7 @@ class WorkOrderController extends Controller
public function index(WorkOrder $workOrder): View
{
$workOrders = $workOrder->with(['user', 'host'])->latest()->paginate(100);
return view('admin.work-orders.index', compact('workOrders'));
}