how to get users thay are must have relation in laravel code example
Example 1: laravel where on relation
Event::whereHas('participants', function ($query) {
$query->where('IDUser', '=', 1);
})->get();
Example 2: laravel get only relationship
$products = $popularProducts->pluck('product');