Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 4 months ago.
0

well... I didn't expect any answer... but to close the issue... I think there is a bug somewhere here (maybe in wherenotexists )

I changed the query to something equivalent to make it work

return DB::table('contact_emails')
		 	->join('user_contacts', 'contact_emails.contact_id', '=', 'user_contacts.contact_id')
			->where('user_contacts.user_id','=',1)
            ->whereNotIn('contact_emails.contact_id',function($query)
            {
                $query->select('event_contacts.contact_id')
                      ->from('event_contacts')
                      ->where('event_contacts.event_id','=',17);
			})
			->get();

Last updated 4 months ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

pocketface pocketface Joined 15 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.