@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function saveProductImages(Collection $collection, Product $product) |
200 | 200 | { |
201 | - $collection->each(function (UploadedFile $file) use ($product) { |
|
201 | + $collection->each(function(UploadedFile $file) use ($product) { |
|
202 | 202 | $filename = $file->store('products', ['disk' => 'public']); |
203 | 203 | $productImage = new ProductImage([ |
204 | 204 | 'product_id' => $product->id, |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function saveCombination(ProductAttribute $productAttribute, AttributeValue ...$attributeValues) : Collection |
249 | 249 | { |
250 | - return collect($attributeValues)->each(function (AttributeValue $value) use ($productAttribute) { |
|
250 | + return collect($attributeValues)->each(function(AttributeValue $value) use ($productAttribute) { |
|
251 | 251 | return $productAttribute->attributesValues()->save($value); |
252 | 252 | }); |
253 | 253 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function listCombinations() : Collection |
259 | 259 | { |
260 | - return $this->model->attributes()->map(function (ProductAttribute $productAttribute) { |
|
260 | + return $this->model->attributes()->map(function(ProductAttribute $productAttribute) { |
|
261 | 261 | return $productAttribute->attributesValues; |
262 | 262 | }); |
263 | 263 | } |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | { |
271 | 271 | $values = $productAttribute->attributesValues()->get(); |
272 | 272 | |
273 | - return $values->map(function (AttributeValue $attributeValue) { |
|
273 | + return $values->map(function(AttributeValue $attributeValue) { |
|
274 | 274 | return $attributeValue; |
275 | - })->keyBy(function (AttributeValue $item) { |
|
275 | + })->keyBy(function(AttributeValue $item) { |
|
276 | 276 | return strtolower($item->attribute->name); |
277 | - })->transform(function (AttributeValue $value) { |
|
277 | + })->transform(function(AttributeValue $value) { |
|
278 | 278 | return $value->value; |
279 | 279 | }); |
280 | 280 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $content = $this->getContent(); |
47 | 47 | |
48 | - $total = $content->reduce(function ($total, CartItem $cartItem) { |
|
48 | + $total = $content->reduce(function($total, CartItem $cartItem) { |
|
49 | 49 | return $total + ($cartItem->qty * $cartItem->priceTax); |
50 | 50 | }, 0); |
51 | 51 |
@@ -163,7 +163,7 @@ |
||
163 | 163 | */ |
164 | 164 | public function getCartItemsTransformed() : Collection |
165 | 165 | { |
166 | - return $this->getCartItems()->map(function (CartItem $item) { |
|
166 | + return $this->getCartItems()->map(function(CartItem $item) { |
|
167 | 167 | $productRepo = new ProductRepository(new Product()); |
168 | 168 | $product = $productRepo->findProductById($item->id); |
169 | 169 | $item->product = $product; |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | protected function mapWebRoutes() |
53 | 53 | { |
54 | 54 | Route::middleware('web') |
55 | - ->namespace($this->namespace) |
|
56 | - ->group(base_path('routes/web.php')); |
|
55 | + ->namespace($this->namespace) |
|
56 | + ->group(base_path('routes/web.php')); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | protected function mapApiRoutes() |
67 | 67 | { |
68 | 68 | Route::prefix('api') |
69 | - ->middleware('api') |
|
70 | - ->namespace($this->namespace) |
|
71 | - ->group(base_path('routes/api.php')); |
|
69 | + ->middleware('api') |
|
70 | + ->namespace($this->namespace) |
|
71 | + ->group(base_path('routes/api.php')); |
|
72 | 72 | } |
73 | 73 | } |
@@ -25,17 +25,17 @@ |
||
25 | 25 | */ |
26 | 26 | public function boot() |
27 | 27 | { |
28 | - view()->composer('layouts.admin.app', function ($view) { |
|
28 | + view()->composer('layouts.admin.app', function($view) { |
|
29 | 29 | $view->with('user', Auth::guard('admin')->user()); |
30 | 30 | $view->with('admin', $this->isAdmin(Auth::guard('admin')->user())); |
31 | 31 | }); |
32 | 32 | |
33 | - view()->composer(['layouts.front.app', 'front.categories.sidebar-category'], function ($view) { |
|
33 | + view()->composer(['layouts.front.app', 'front.categories.sidebar-category'], function($view) { |
|
34 | 34 | $view->with('categories', $this->getCategories()); |
35 | 35 | $view->with('cartCount', $this->getCartCount()); |
36 | 36 | }); |
37 | 37 | |
38 | - view()->composer(['layouts.front.category-nav'], function ($view) { |
|
38 | + view()->composer(['layouts.front.category-nav'], function($view) { |
|
39 | 39 | $view->with('categories', $this->getCategories()); |
40 | 40 | }); |
41 | 41 | } |