@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * Determine if a cart exists or not. |
| 28 | 28 | * |
| 29 | 29 | * @param CartRepository $repository |
| 30 | - * @return bool |
|
| 30 | + * @return string|null |
|
| 31 | 31 | */ |
| 32 | 32 | public function exists(CartRepository $repository) |
| 33 | 33 | { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $item->load([ |
| 48 | 48 | 'inventory.optionValues.option', |
| 49 | - 'inventory.product' => function ($product) { |
|
| 49 | + 'inventory.product' => function($product) { |
|
| 50 | 50 | return $product->joinPrice()->with('thumbnails'); |
| 51 | 51 | }, |
| 52 | 52 | ]); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $token = $this->getToken(); |
| 116 | 116 | |
| 117 | - if (! $token) { |
|
| 117 | + if (!$token) { |
|
| 118 | 118 | return $this->create(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function getToken() |
| 138 | 138 | { |
| 139 | 139 | $token = Session::get(self::CART_KEY); |
| 140 | - if (! $token && Cookie::has(self::CART_KEY)) { |
|
| 140 | + if (!$token && Cookie::has(self::CART_KEY)) { |
|
| 141 | 141 | $token = Cookie::get(self::CART_KEY); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | public function loadCart() |
| 153 | 153 | { |
| 154 | 154 | $this->getCart()->load([ |
| 155 | - 'items.inventory.product' => function ($product) { |
|
| 155 | + 'items.inventory.product' => function($product) { |
|
| 156 | 156 | $product->joinPrice()->with('thumbnails'); |
| 157 | 157 | }, |
| 158 | 158 | 'items.inventory.optionValues.option', |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_promotions', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_promotions', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->increments('id'); |
| 14 | 14 | $table->string('name')->default(''); |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public static function bootStartEndable() |
| 15 | 15 | { |
| 16 | - static::extend(function ($model) { |
|
| 17 | - $model->bindEvent('model.afterValidate', function () use ($model) { |
|
| 16 | + static::extend(function($model) { |
|
| 17 | + $model->bindEvent('model.afterValidate', function() use ($model) { |
|
| 18 | 18 | $model->validateStartEndDates(); |
| 19 | 19 | }); |
| 20 | 20 | }); |
@@ -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 | /** |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * Apply a promotion to the cart. |
| 51 | 51 | * |
| 52 | - * @param string $code The promotion code to apply. |
|
| 52 | + * @param string $name |
|
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | 55 | public function applyPromotion($name) |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | protected function updatePrimaryAddresses() |
| 120 | 120 | { |
| 121 | - if (! $this->customer_id) { |
|
| 121 | + if (!$this->customer_id) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_customers', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_customers', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->increments('id'); |
| 14 | 14 | $table->string('name')->default(''); |