I am trying to do get all the latest items and sort by id descending (i.e. get all items that were just added with a limit and offset).
This is my code-
$products = Product::all() ->slice($request->get('offset')) ->take($request->get('limit')) ->sortByDesc('id') ->toBase();
However it seems when I have more that that limit, then I dont have the right order. It gets me say 10 products but not sorted corrected. Any idea how to do this?