laravel get models which doesent have relation data code example
Example: laravel where on relation
Event::whereHas('participants', function ($query) {
$query->where('IDUser', '=', 1);
})->get();
Event::whereHas('participants', function ($query) {
$query->where('IDUser', '=', 1);
})->get();