Cleanup and expansion to accomodate repeated expenses.

This commit is contained in:
James Cole
2014-11-22 23:32:10 +01:00
parent 3d3842b9d6
commit 4a74e68e31
3 changed files with 11 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
<?php
use LaravelBook\Ardent\Ardent as Ardent;
use Carbon\Carbon;
use LaravelBook\Ardent\Ardent;
use LaravelBook\Ardent\Builder;
/**
* PiggybankRepetition
@@ -63,5 +64,12 @@ class PiggybankRepetition extends Ardent
return $this->belongsTo('Piggybank');
}
public function scopeStarts(Builder $query, Carbon $date) {
$query->where('startdate',$date->format('Y-m-d'));
}
public function scopeTargets(Builder $query, Carbon $date) {
$query->where('targetdate',$date->format('Y-m-d'));
}
}