Answer the question
In order to leave comments, you need to log in
How to convert sql query to Eloquent relation in laravel?
Good afternoon.
I need to get all members ( members ) in the games played.
select
members.id,
members.game_id,
members.profile_id
from
members
where
members.id in (
select
games.id
from
games
left join members on games.id = members.game_id
left join profiles on profiles.id = members.profile_id
where profiles.id = '4'
) and member.profile_id != '4';
Answer the question
In order to leave comments, you need to log in
The original SQL query at first glance returns some kind of game:
members.id in (
select
games.id
from
games
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question