I am working with Laravel 8 to develop online ordering project and in this project, I want to show all the orders from orders table if the status of each order is set to awaiting, so here is my code:
public function awaiting()
{
$orders = Order::with('user')->where('status', 'awaiting')->whereHas('user')->latest()->paginate(20);
return view('admin.orders.awaiting', compact('orders'));
}
But now the problem is, it only shows the first result from table, however there are more than one record stored at orders table.
How can I fix this issue?
UPDATE #1:
