Shift::whereRaw('id NOT IN (SELECT shift_id from absenceline')->get();
// sql: select * from shifts where id not in (select shift_id from absenceline)
or more eloquent way:
Shift::has('absenceLine', '=', 0)->get();
// sql: select * from shifts where (select count(*) from absenceline where absenceline.shift_id = shifts.id) = 0
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community