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
what shall I do next …
>Solution :
Simply put this {{ $users->links() }} where you want to show your pagination. It will work automatically.