Commit 676af1c0 authored by Artem's avatar Artem

add pagination on profile orders page

parent 64482d8b
......@@ -14,7 +14,7 @@ class ProfileController extends Controller
public function showOrders()
{
$orders = Auth::user()->orders->reverse() ; // ->take(10)
$orders = Auth::user()->orders()->orderBy('id', 'desc')->paginate(10);
return view('profile.orders', compact('orders'));
}
......
......@@ -34,5 +34,6 @@
</div>
</div>
@endforeach
{{ $orders->links() }}
@endif
@endsection
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment