|
@@ -32,7 +32,20 @@ class Client extends Model
|
|
|
}
|
|
|
|
|
|
public function notes() {
|
|
|
- return $this->hasMany(Note::class, 'client_id', 'id')->orderBy('effective_dateest', 'desc');
|
|
|
+ return $this->hasMany(Note::class, 'client_id', 'id')
|
|
|
+ ->orderBy('effective_dateest', 'desc');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function activeNotes() {
|
|
|
+ return $this->hasMany(Note::class, 'client_id', 'id')
|
|
|
+ ->where('is_cancelled', false)
|
|
|
+ ->orderBy('effective_dateest', 'desc');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function cancelledNotes() {
|
|
|
+ return $this->hasMany(Note::class, 'client_id', 'id')
|
|
|
+ ->where('is_cancelled', true)
|
|
|
+ ->orderBy('effective_dateest', 'desc');
|
|
|
}
|
|
|
|
|
|
public function sections() {
|