Add whereNeedsBill and whereNeedsRemember Scopes
This commit is contained in:
parent
b389fae4b1
commit
a3b52a0077
|
@ -31,4 +31,16 @@ class Payment extends Model
|
||||||
return $q->needsPayment();
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue