Laravel 8 自定义分页器 URI
2021-07-19 11:17 更新
withPath 方法允许你在生成分页链接时自定义 URI。例如,如果你想生成像 http://example.com/custom/url?page=N 的分页链接,你应该传递 custom/url 参数给 withPath 方法:
Route::get('users', function () {
$users = App\Models\User::paginate(15);
$users->withPath('custom/url');
//
}); 以上内容是否对您有帮助:

免费 AI IDE


更多建议: