@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * @var array Guarded fields |
| 47 | 47 | */ |
| 48 | - protected $guarded = ['*']; |
|
| 48 | + protected $guarded = [ '*' ]; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * @var array Fillable fields |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * @var array Relations |
| 73 | 73 | */ |
| 74 | - public $hasMany = []; |
|
| 75 | - public $morphMany = []; |
|
| 74 | + public $hasMany = [ ]; |
|
| 75 | + public $morphMany = [ ]; |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * @var array Validation rules |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function filterFields($fields) |
| 115 | 115 | { |
| 116 | 116 | $fields->amount_exact->hidden = $this->is_percentage; |
| 117 | - $fields->amount_percentage->hidden = ! $this->is_percentage; |
|
| 117 | + $fields->amount_percentage->hidden = !$this->is_percentage; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | public function scopeSelectStatus($query) |
| 131 | 131 | { |
| 132 | 132 | $grammar = $query->getQuery()->getGrammar(); |
| 133 | - $start_at = $grammar->wrap($this->table . '.start_at'); |
|
| 134 | - $end_at = $grammar->wrap($this->table . '.end_at'); |
|
| 133 | + $start_at = $grammar->wrap($this->table.'.start_at'); |
|
| 134 | + $end_at = $grammar->wrap($this->table.'.end_at'); |
|
| 135 | 135 | $now = Carbon::now(); |
| 136 | 136 | |
| 137 | - $subquery = "CASE " . |
|
| 138 | - "WHEN ({$end_at} IS NOT NULL AND {$end_at} < '{$now}') THEN 0 " . |
|
| 139 | - "WHEN ({$start_at} IS NOT NULL AND {$start_at} > '{$now}') THEN 2 " . |
|
| 140 | - "ELSE 1 " . |
|
| 137 | + $subquery = "CASE ". |
|
| 138 | + "WHEN ({$end_at} IS NOT NULL AND {$end_at} < '{$now}') THEN 0 ". |
|
| 139 | + "WHEN ({$start_at} IS NOT NULL AND {$start_at} > '{$now}') THEN 2 ". |
|
| 140 | + "ELSE 1 ". |
|
| 141 | 141 | "END"; |
| 142 | 142 | |
| 143 | 143 | return $query->selectSubquery($subquery, 'status'); |