Laravel - Ajouter une clause conditionnelle dans la requête

$user_to_mail = User::where('store_id', $item->store_id)
                    ->when($store->notification_role_id > 0, function ($q) use ($store) {
                        return $q->where('role_id', $store->notification_role_id);
                    })
                    ->get();
Fani385