Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel pagination links problem with the design [closed]

Hi I was using a specific template with assets and plugins in my laravel project. Now I removed the template and deleted the plugins and assets I was using. Now in the data table I have created pagination links appear really weird and it seems nothing can fix them. What can be done in this case.

 {{$employees->links()}}

enter image description here

like image 469
kris7i Avatar asked Oct 15 '25 04:10

kris7i


1 Answers

You can try to paginate manually, so you can add your own styling to it.

<!-- a Tag for previous page -->
<a href="{{$employees->previousPageUrl()}}">
    <!-- You can insert logo or text here -->
</a>
@for($i=0;$i<=$employees->lastPage();$i++)
    <!-- a Tag for another page -->
    <a href="{{$employees->url($i)}}">{{$i}}</a>
@endfor
<!-- a Tag for next page -->
<a href="{{$employees->nextPageUrl()}}">
    <!-- You can insert logo or text here -->
</a>

You can add your own styling by doing this manually, because when you used $employees->links() it will be automatically use bootstrap class name. Here is the description from laravel docs

The links method will render the links to the rest of the pages in the result set. Each of these links will already contain the proper page query string variable. Remember, the HTML generated by the links method is compatible with the Bootstrap CSS framework.

Good luck.

like image 150
WU191 Avatar answered Oct 16 '25 16:10

WU191