Comparaison de deux tables dans Laravel en utilisant le modèle

$paidFeesIds = Fee::whereHas('paidFees', function($q) {
    $q->where('payment_status', 1);
})->pluck('id')->toArray();

$notPaidFeesIds = Fee::whereNotIn('id', $paidFeesIds)->pluck('id')->toArray();
Anxious Anteater