На данный момент у меня есть 3 запроса:
Код: Выделить всё
$orderCount = Order::count();
$newOrderCount = Order::where('status', '=', 'new')->count();
$completedOrderCount = Order::where('status', '=', 'completed')->count();
Подробнее здесь: https://stackoverflow.com/questions/677 ... -one-table