Question : laravel where doesn't have
Answered by : victorious-vicua-vgg3s6vlh1lg
// get all Videos that don't belong to category 2 and 3
Video::whereDoesntHave('categories', function($query) { $query->whereIn('id', [2, 3]);
})->get();
Source : https://stackoverflow.com/questions/43821403/laravel-belongstomany-where-doesnt-have-one-of | Last Update : Tue, 28 Dec 21