Как преобразовать простой запрос MySQL в красноречивый Laravel?
на самом деле я хочу преобразовать вниз запрос:
SELECT temp.* FROM
(SELECT * FROM avilableproducts ORDER BY avilableproducts.count DESC) AS temp
GROUP BY temp.products_id, temp.color
HAVING temp.products_id = 27
ORDER BY temp.count DESC;
в
$Avilableproducts = $Avilableproducts->select(DB::raw('temp.*'))
->from(DB::raw('(SELECT * FROM avilableproducts ORDER BY count DESC) AS temp'))
->groupBy(['products_id', 'color'])
->orderBy('count', 'desc');
Задача ещё не решена.
Других решений пока нет …