从7.9.2升级到Laravel 8.x之后,$ user->links()的用户界面有问题,可能是引导程序 [英] After updating to Laravel 8.x from 7.9.2, $user -> links() has a problem with the user interface, bootstrap maybe

查看:37
本文介绍了从7.9.2升级到Laravel 8.x之后,$ user->links()的用户界面有问题,可能是引导程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Laravel项目从7.9.2更新到了8.x.一切正常,除了前端的那部分有问题,可能是引导程序有问题,您知道为什么吗?当我使用$ user->时,下一页和上一页的箭头;我完成$ users = Users :: paginate(20)之后的links();越野车.请看这些图片,请帮帮我:

I updated a Laravel project to 8.x from 7.9.2. Everything works properly, except this part from the frontend, which is buggy, seems like a problem with the bootstrap maybe, do you know why? The arrows for the next and previous pages, when I use $user -> links() after I did $users = User::paginate(20); are buggy. See these pictures please, please help me:

在更新到Laravel 8.x之前

Before updating to Laravel 8.x

更新为Laravel 8.x

After updating to Laravel 8.x

推荐答案

默认情况下,Laravel-8使用Tailwind作为CSS框架,但如果要升级应用程序,则可以将Bootstrap保留为应用程序的默认CSS框架从以前的版本开始.

By default, Laravel-8 is using Tailwind as a CSS framework, but you can keep Bootstrap as the default CSS framework for your app if you are upgrading your app from the previous versions.

只需在 AppServiceProvider 文件中添加以下代码并全部设置:

Simply add the following code in AppServiceProvider file and all set:

use Illuminate\Pagination\Paginator;

Paginator::useBootstrap(); *//this line will be in boot method*

这是相同的参考链接: https://laravel.com/docs/8.x/upgrade#pagination-默认值

And here is the reference link for the same: https://laravel.com/docs/8.x/upgrade#pagination-defaults

这篇关于从7.9.2升级到Laravel 8.x之后,$ user->links()的用户界面有问题,可能是引导程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆