Laravel does not show all the available results from table

  eloquent, laravel, laravel-8, php

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.

So what is going wrong here? How can I fix this issue?

I would really appreciate any idea or suggestion from you guys…

Thanks in advance.


enter image description here

Source: Laravel

Leave a Reply