Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After updating to Laravel 8.x from 7.9.2, $user -> links() has a problem with the user interface, bootstrap maybe

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:

Before updating to Laravel 8.x

Before

After updating to Laravel 8.x

enter image description here

like image 866
Vladimir B. Avatar asked Mar 03 '23 01:03

Vladimir B.


2 Answers

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.

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

use Illuminate\Pagination\Paginator;

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

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

like image 195
Aamirpal Sehmi Avatar answered Mar 05 '23 15:03

Aamirpal Sehmi


It is a modification made in Laravel 8. Laravel includes pagination views built using Bootstrap CSS, call the paginator's useBootstrap method within your AppServiceProvider. Check: https://laravel.com/docs/8.x/pagination#using-bootstrap

In App\Providers\AppServiceProvider add de following lines:

use Illuminate \ Pagination \ Paginator;

public function boot ()
{
      Paginator::useBootstrap();
}
like image 24
Alexandre Strapacao G. Vianna Avatar answered Mar 05 '23 15:03

Alexandre Strapacao G. Vianna