Laravel Pagination is showing weird arrows
Asked Answered
C

3

36

So I used simple Laravel pagination command of {{$posts->links()}} displaying 5 posts on one page. Laravel's pagination is doing its job but it is displaying weird arrows. Refer the image below and please if someone is willing to help can ask me for codes I will share them. a

Colenecoleopteran answered 22/9, 2020 at 3:41 Comment(6)
welcome to SO .. did you checked you are using right bootstrap .? or notAargau
Yes I have.I am doing a course on laravel so the instructor provided the bootstrap filesColenecoleopteran
You have devtools open, so ... use them! :-) Select the arrow on the page, find out what CSS/HTML is causing it. You're going to need to learn how to debug if you're learning to code :-)Artiste
It's not laravel issue. It happened from front endOrabelle
if its the issue from the front end how can I get to know the location where it is typed in wrong way?Colenecoleopteran
I think it's a legitimate question. The same happens to me in Laravel 8. It looks like there is a style problem with links() function. I tried a fresh new Laravel 8.x installation with the default bootstrap. This usually works in previous versions. For now try to generate the links manually: laravel.com/docs/8.x/paginationEpispastic
D
71

Here is official document that talk about it. You can check it

Inside AppServiceProvider


use Illuminate\Pagination\Paginator;

public function boot()
{
    Paginator::useBootstrap();
}

Doc: https://laravel.com/docs/8.x/pagination#using-bootstrap

Sample implementation: https://www.itsolutionstuff.com/index.php/post/laravel-8-pagination-example-tutorialexample.html

Dustydusza answered 15/10, 2020 at 13:42 Comment(2)
This initially fixed my issue, but after I use "use WithPagination;" it messed up again. I want to use it as it reload page with ajax request. Any solutions. Thanks.Japha
This is the working answer, thanks.Byram
T
45

I put as an argument on the "links" method, a version of Bootstrap which works right:

$posts->links('pagination::bootstrap-4')
Tanbark answered 15/10, 2020 at 0:39 Comment(3)
This worked for me {{$posts->links('pagination::bootstrap-5') in my caseDikdik
i have try this issue, is work successfuly. tank you I'm in Lomé-TOGOClavicorn
Works like a charm laravel 11Souter
V
5

I found the answer to this question here: i used laravel pagination links, but i got big icos. < > call in tailwind css code

You need to add this line to tailwind.config.js under content:

 './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
Vestment answered 20/2, 2023 at 21:43 Comment(2)
Fixed my issue with laravel 10. Thx!Shew
Works great with recent Laravel!Daystar

© 2022 - 2024 — McMap. All rights reserved.