@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function scopeIsActive(Builder $query) |
| 15 | 15 | { |
| 16 | - return $query->where(function ($model) { |
|
| 16 | + return $query->where(function($model) { |
|
| 17 | 17 | return $model->isNotExpired()->isNotUpcoming(); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function scopeIsExpired(Builder $query) |
| 28 | 28 | { |
| 29 | - return $query->where(function ($model) { |
|
| 29 | + return $query->where(function($model) { |
|
| 30 | 30 | return $model->whereNotNull('end_at') |
| 31 | 31 | ->where('end_at', '<=', (string) Carbon::now()); |
| 32 | 32 | }); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function scopeIsUpcoming(Builder $query) |
| 42 | 42 | { |
| 43 | - return $query->where(function ($model) { |
|
| 43 | + return $query->where(function($model) { |
|
| 44 | 44 | return $model->whereNotNull('start_at') |
| 45 | 45 | ->where('start_at', '>', (string) Carbon::now()); |
| 46 | 46 | }); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function scopeIsNotActive(Builder $query) |
| 56 | 56 | { |
| 57 | - return $query->where(function ($model) { |
|
| 57 | + return $query->where(function($model) { |
|
| 58 | 58 | return $model->isExpired()->orWhere(function($q) { |
| 59 | 59 | $q->isUpcoming(); |
| 60 | 60 | }); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function scopeIsNotExpired(Builder $query) |
| 71 | 71 | { |
| 72 | - return $query->where(function ($model) { |
|
| 72 | + return $query->where(function($model) { |
|
| 73 | 73 | return $model->whereNull('end_at') |
| 74 | 74 | ->orWhere('end_at', '>', (string) Carbon::now()); |
| 75 | 75 | }); |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function scopeIsNotUpcoming(Builder $query) |
| 84 | 84 | { |
| 85 | - return $query->where(function ($model) { |
|
| 86 | - return $model->isExpired()->orWhere(function ($q) { |
|
| 85 | + return $query->where(function($model) { |
|
| 86 | + return $model->isExpired()->orWhere(function($q) { |
|
| 87 | 87 | $q->isActive(); |
| 88 | 88 | }); |
| 89 | 89 | }); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @var array Guarded fields |
| 48 | 48 | */ |
| 49 | - protected $guarded = ['*']; |
|
| 49 | + protected $guarded = [ '*' ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * @var array Fillable fields |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | public function filterFields($fields) |
| 131 | 131 | { |
| 132 | 132 | $fields->amount_exact->hidden = $this->is_percentage; |
| 133 | - $fields->amount_percentage->hidden = ! $this->is_percentage; |
|
| 133 | + $fields->amount_percentage->hidden = !$this->is_percentage; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |