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.
The pagination option specifies which view should be used to create pagination links. By default, Laravel includes two views. The pagination::slider view will show an intelligent "range" of links based on the current page, while the pagination::simple view will simply show "previous" and "next" buttons.
Laravel provides pagination out of the box for Eloquent Collections, but you can't use that by default on ordinary Collections. Collections do have the forPage() method, but it's more low-level, so it doesn't generate pagination links. So you have to create a LengthAwarePaginator instance.
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
I put as an argument on the "links" method, a version of Bootstrap which works right:
$posts->links('pagination::bootstrap-4')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With