Level 4
you don't need all at all
$category = ProductCategory::paginate(15);
I am trying to fetch all rows from a table, and use pagination, but seems like
$category = ProductCategory::all()->paginate(15);
Cant be done as it returns a collection.
What is the right way of retrieving all results and using pagination.
Is it must that I should use a where()? and what condition should I use?
you don't need all at all
$category = ProductCategory::paginate(15);
Please or to participate in this conversation.