Hello $data = User::paginate(5); return view('users',compact('data')); {!! $data->links() !!}
Asked
Active
Viewed 969 times
2
Shekhar Rudra
- 149
- 3
- 7
2 Answers
3
Laravel uses tailwind JIT mode which imports (when you run npm run dev) required classes when they are needed, the pagination is not included in your HTML explicitly with links() so I believe required classes are not included
in the file tailwind.config.js, make sure that all the following are included in content:[]
content: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
'./resources/**/*.vue',
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
],
xashm
- 31
- 3
1
app\Providers\AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
//
}
public function boot()
{
Paginator::useBootstrap();
}
}
Shekhar Rudra
- 149
- 3
- 7
-
Laravel 8 pagination by default call tailwind css , and not use bootsrap. – Shekhar Rudra Apr 22 '21 at 09:33
-
2You use a bootstrap, so add a code app\Providers\AppServiceProvider.php use Illuminate\Pagination\Paginator; public function boot() { Paginator::useBootstrap(); } – Shekhar Rudra Apr 22 '21 at 09:39