Add whereNeedsBill and whereNeedsRemember Scopes

This commit is contained in:
philipp lang 2021-07-15 21:19:08 +02:00
parent b389fae4b1
commit a3b52a0077
1 changed files with 12 additions and 0 deletions

View File

@ -31,4 +31,16 @@ class Payment extends Model
return $q->needsPayment();
});
}
public function scopeWhereNeedsBill($q) {
return $q->whereHas('status', function($q) {
return $q->where('is_bill', true);
});
}
public function scopeWhereNeedsRemember($q) {
return $q->whereHas('status', function($q) {
return $q->where('is_remember', true);
});
}
}