mardi 6 août 2019

Laravel pagination problem when deleting item

I'm getting an empty page after deleting products from second page in pagination, I have two pages in pagination the first page with 4 products and the second page with 1 product so if I delete the product from the second page it shows empty page which means I have no products instead of displaying the first page with 4 products. How do I fix this?

Controller

 $products = product::where('admin', $userId)->paginate(4);

Blade template

 <div class="pagination">
     
 </div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire