Level 102
Why are you converting to array in the first place? I cannot think of a case where that is needed
You can try
$orders = Order::with('customer')->withCount('orderItems')->paginate(50);
dd($orders->items()->toArray());
1 like
Here is my code.
$orders = Order::with('customer')->withCount('orderItems')->paginate(50)->toArray();
This code return me the blank page. No data return. So here's what I did wrong?
Why are you converting to array in the first place? I cannot think of a case where that is needed
You can try
$orders = Order::with('customer')->withCount('orderItems')->paginate(50);
dd($orders->items()->toArray());
Please or to participate in this conversation.