Как то так. Но честно говоря мне писать такие запросы без IDE это тоскливо - мог накосячить
$fleets = DB::table('fleets') // записи кроме $arr
->join('fleet_dictionaries', 'fleet_dictionaries.id', '=', 'fleets.fleet_id')
->select('fleets.fleet_id','fleet_dictionaries.manufacture','fleet_dictionaries.description', DB::RAW('IF(ISNULL(fleets_with_dopusk.fleet_id), "есть допуск", "нет допуска")'))
->leftJoinSub(function($query) use($id){
return $query->from('fleet_users')
->join('fleet_dictionaries', 'fleet_dictionaries.id', '=', 'fleet_users.fleet_id')
->select('fleet_users.fleet_id')
->where('fleet_users.user_id', $id);
}, 'fleets_with_dopusk', 'fleets_with_dopusk.fleet_id', '=', 'fleet_users.fleet_id')
->where('fleets.airline_id', $idport)
->distinct('fleets.fleet_id')
->get();
$fleets = DB::table('fleets') // записи кроме $arr
->join('fleet_dictionaries', 'fleet_dictionaries.id', '=', 'fleets.fleet_id')
->select('fleets.fleet_id','fleet_dictionaries.manufacture','fleet_dictionaries.description')
->whereNotIn('fleets.fleet_id', function($query) use($id){
return $query->from('fleet_users')
->join('fleet_dictionaries', 'fleet_dictionaries.id', '=', 'fleet_users.fleet_id')
->select('fleet_users.fleet_id')
->where('fleet_users.user_id', $id);
})
->where('fleets.airline_id', $idport)
->distinct('fleets.fleet_id')
->get();