Reverse the order on Foreach of a Paginator

Submitted by diegofelix - 9 years ago

Sometimes you want to paginate a table in an order, but when showing the items you need to reverse the order. Using the array_reverse on Paginator wont work, but if you use the getItems() its possible.

@foreach (array_reverse($products->getItems()) as $product)
    
    {{ $product->name }}

@endforeach