Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

laravel pagination , show data when click on next page

So I’m new to laravel and I want to know how to make pagination work, in my controller I have this in the index

$users = Villa::with('City','Seller', 'Payment')->simplePaginate(3);

and for the blade, pagination nav

     <nav class="mt-4 " aria-label="..." >
          <ul class="pagination pagination-lg">
            <li class="page-item active" aria-current="page" >
              <span class="page-link">1</span>
            </li>
            <li class="page-item"><a class="page-link" href="">2</a></li>
            <li class="page-item"><a class="page-link" href="">3</a></li>
          </ul>
        </nav>

the goal is when I click on the (next page) I want it to route me to the rest of the data

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

what shall I do next …

>Solution :

Simply put this {{ $users->links() }} where you want to show your pagination. It will work automatically.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading