Eloquent – Join distinct results with another table

  distinct, eloquent, join, laravel, postgresql

Is there a way to write this query in Eloquent?

select * from (select distinct source_id from csv_report) CR JOIN source SRC on CR.source_id = SRC.id;

I don’t have the Models relations set up yet.

Thanks.

EDIT: Sorry if I didn’t ask the question correctly (because of the negative point). I figured the table details (cols etc) is not important here. I can add them if it’s needed.

Source: Laravel

Leave a Reply