You can create this query
SELECT * FROM users AS t1
LEFT JOIN installs AS t2 ON (t1.id = t2.usuario_id AND t2.station_id = 223 )
WHERE t2.usuario_id IS NULL
DB::table('users')->leftJoin('installs', 'users.id', '=', 'installs.usuario_id')->whereNull('installs.usuario_id')->where('installs.station_id', '=', 223)->get();
That creates the SQL string:
select * from `users` left join `installs` on `users`.`id` = `installs`.`usuario_id` where `installs`.`usuario_id` is null and `installs`.`station_id` = ?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community