how to join in laravel on a select result with eloquent?
I want to join on a result of other select like this :
SELECT *
FROM TABLE1
JOIN (
SELECT cat_id FROM TABLE2 where brand_id = 2 GROUP BY TABLE2.cat_id) AS b ON TABLE1.id = b.cat_id
is there any way to do this with eloquent?
from Laravel Questions and Answers https://laravelquestions.com/laravel/how-to-join-in-laravel-on-a-select-result-with-eloquent/
via Lzo Media
No comments:
Post a Comment