mardi 22 mai 2018

MySql Raw Query into Laravel 5.5 Eloquent ORM

I have mySql query an I want to convert it into Laravel 5.5 Eloquent ORM.

mySql Query:

SELECT i.category_id, count(i.id) as count FROM `items` i INNER JOIN item_categories c ON c.id = i.`category_id` GROUP BY i.`category_id`

This query is working. Is there any way to convert it easily into eloquent or anyone can make it for me.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire