3 months ago

Pagination and all()

Posted 3 months ago by repulsor

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?

Please sign in or create an account to participate in this conversation.