Total Complexity | 8 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 57.14% |
Changes | 0 |
1 | <?php |
||
7 | trait HasPeriodTrait |
||
8 | { |
||
9 | 8 | protected static function bootHasPeriodTrait() |
|
12 | 8 | } |
|
13 | |||
14 | 8 | public function initializeHasPeriodTrait() |
|
17 | 8 | } |
|
18 | |||
19 | 1 | public function scopePassed($query) |
|
22 | } |
||
23 | |||
24 | 1 | public function scopeUpcoming($query) |
|
27 | } |
||
28 | |||
29 | 1 | public function scopeOngoing($query) |
|
30 | { |
||
31 | 1 | return $query->where('start_at', '<', Carbon::now())->where('end_at', '>', Carbon::now()); |
|
32 | } |
||
33 | |||
34 | public function saveStartAtField($start_at) |
||
40 | } |
||
41 | |||
42 | public function saveEndAtField($end_at) |
||
50 |