@@ -83,7 +83,7 @@ |
||
| 83 | 83 | public function filterFields($fields) |
| 84 | 84 | { |
| 85 | 85 | $fields->amount_exact->hidden = $this->is_percentage; |
| 86 | - $fields->amount_percentage->hidden = ! $this->is_percentage; |
|
| 86 | + $fields->amount_percentage->hidden = !$this->is_percentage; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | public function filterFields($fields) |
| 127 | 127 | { |
| 128 | 128 | $fields->amount_exact->hidden = $this->is_percentage; |
| 129 | - $fields->amount_percentage->hidden = ! $this->is_percentage; |
|
| 129 | + $fields->amount_percentage->hidden = !$this->is_percentage; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $productIds = $this->products()->lists('id'); |
| 140 | 140 | $categories = $this->categories() |
| 141 | - ->with(['products' => function ($product) { |
|
| 141 | + ->with(['products' => function($product) { |
|
| 142 | 142 | return $product->select('id'); |
| 143 | 143 | }]) |
| 144 | 144 | ->get(['id']); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | public function savePrices() |
| 181 | 181 | { |
| 182 | 182 | $id = $this->id; |
| 183 | - Queue::push(function ($job) use ($id) { |
|
| 183 | + Queue::push(function($job) use ($id) { |
|
| 184 | 184 | $discount = Discount::findOrFail($id); |
| 185 | 185 | $productIds = $discount->getAllProductIds(); |
| 186 | 186 | $products = Product::whereIn('id', $productIds)->select('id', 'base_price')->get(); |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | public static function syncProductPrice(Product $product, array $categoryIds) |
| 232 | 232 | { |
| 233 | 233 | $discounts = self::isNotExpired() |
| 234 | - ->whereHas('products', function ($query) use ($product) { |
|
| 234 | + ->whereHas('products', function($query) use ($product) { |
|
| 235 | 235 | return $query->where('id', $product->id); |
| 236 | 236 | }) |
| 237 | - ->orWhereHas('categories', function ($query) use ($categoryIds) { |
|
| 237 | + ->orWhereHas('categories', function($query) use ($categoryIds) { |
|
| 238 | 238 | return $query->whereIn('id', $categoryIds); |
| 239 | 239 | }) |
| 240 | 240 | ->get(); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | public static function bootAmountable() |
| 11 | 11 | { |
| 12 | - static::extend(function ($model) { |
|
| 12 | + static::extend(function($model) { |
|
| 13 | 13 | $model->rules = array_merge($model->rules, [ |
| 14 | 14 | 'amount_exact' => 'numeric|min:0', |
| 15 | 15 | 'amount_percentage' => 'numeric|min:0|max:100', |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $model->addFillable('amount_exact', 'amount_percentage'); |
| 29 | 29 | |
| 30 | - $model->bindEvent('model.beforeSave', function () use ($model) { |
|
| 30 | + $model->bindEvent('model.beforeSave', function() use ($model) { |
|
| 31 | 31 | $model->setAmount(); |
| 32 | 32 | }); |
| 33 | 33 | }); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function getAmountExactAttribute() |
| 42 | 42 | { |
| 43 | - return ! $this->is_percentage ? $this->amount : 0; |
|
| 43 | + return !$this->is_percentage ? $this->amount : 0; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |