i used laravel pagination links, but i got big icos. < > call in tailwind css code
Asked Answered
N

3

2

Hello $data = User::paginate(5); return view('users',compact('data')); {!! $data->links() !!}

Noh answered 22/4, 2021 at 9:28 Comment(0)
Z
5

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',
],
Zeitler answered 6/2, 2022 at 10:40 Comment(0)
N
2

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();
    }
}
Noh answered 22/4, 2021 at 9:31 Comment(2)
Laravel 8 pagination by default call tailwind css , and not use bootsrap.Noh
You use a bootstrap, so add a code app\Providers\AppServiceProvider.php use Illuminate\Pagination\Paginator; public function boot() { Paginator::useBootstrap(); }Noh
S
1

The following command: php artisan vendor:publish --tag=laravel-pagination can be used to copy all the templates used by Laravel for pagination into the resources/vendor/pagination directory.

This directory is included in tailwind.config.js when configured with the default settings suggested by Tailwind for Laravel, so it's not necessary to add the pagination path in the content.

It's possible to keep only tailwind.blade.php in resources/vendor/pagination to avoid unnecessary duplication.

Seedtime answered 8/6 at 23:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.