Laravel many to many whereDoesntHave
I have this code here simplified. Post::whereDoesntHave('tags', function($query){ $query->whereIn(tags.id, $tagIds); }) Lets say that tagIds = [1,2,3] My goal is to retrieve only Posts that do not contain all of those tags. ex. if post has tags 1,2,3 , then…