@@ -166,7 +166,7 @@ |
||
| 166 | 166 | */ |
| 167 | 167 | public function getCartItemsTransformed() : Collection |
| 168 | 168 | { |
| 169 | - return $this->getCartItems()->map(function ($item) { |
|
| 169 | + return $this->getCartItems()->map(function($item) { |
|
| 170 | 170 | $productRepo = new ProductRepository(new Product()); |
| 171 | 171 | $product = $productRepo->findProductById($item->id); |
| 172 | 172 | $item->product = $product; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function setDeliveryAddress(Address $address) |
| 83 | 83 | { |
| 84 | - $delivery = [ |
|
| 84 | + $delivery = [ |
|
| 85 | 85 | 'name' => $address->alias, |
| 86 | 86 | 'street1' => $address->address_1, |
| 87 | 87 | 'city' => $address->city, |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function readyParcel(Collection $collection) |
| 131 | 131 | { |
| 132 | - $weight = $collection->map(function ($item) { |
|
| 132 | + $weight = $collection->map(function($item) { |
|
| 133 | 133 | return [ |
| 134 | 134 | 'weight' => $item->product->weight * $item->qty, |
| 135 | 135 | 'mass_unit' => $item->product->mass_unit |
| 136 | 136 | ]; |
| 137 | - })->map(function ($item) { |
|
| 137 | + })->map(function($item) { |
|
| 138 | 138 | $total = 0; |
| 139 | 139 | switch ($item['mass_unit']) { |
| 140 | 140 | case Product::MASS_UNIT['OUNCES'] : |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $total += $oz; |
| 143 | 143 | break; |
| 144 | 144 | case Product::MASS_UNIT['GRAMS'] : |
| 145 | - $oz = $item['weight'] * 0.0022; |
|
| 145 | + $oz = $item['weight'] * 0.0022; |
|
| 146 | 146 | $total += $oz; |
| 147 | 147 | break; |
| 148 | 148 | default: |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | public function dissociateProducts() |
| 122 | 122 | { |
| 123 | - $this->model->products()->each(function (Product $product) { |
|
| 123 | + $this->model->products()->each(function(Product $product) { |
|
| 124 | 124 | $product->brand_id = null; |
| 125 | 125 | $product->save(); |
| 126 | 126 | }); |
@@ -29,16 +29,16 @@ |
||
| 29 | 29 | 'layouts.admin.app', |
| 30 | 30 | 'layouts.admin.sidebar', |
| 31 | 31 | 'admin.shared.products' |
| 32 | - ], function ($view) { |
|
| 32 | + ], function($view) { |
|
| 33 | 33 | $view->with('admin', Auth::guard('employee')->user()); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - view()->composer(['layouts.front.app', 'front.categories.sidebar-category'], function ($view) { |
|
| 36 | + view()->composer(['layouts.front.app', 'front.categories.sidebar-category'], function($view) { |
|
| 37 | 37 | $view->with('categories', $this->getCategories()); |
| 38 | 38 | $view->with('cartCount', $this->getCartCount()); |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - view()->composer(['layouts.front.category-nav'], function ($view) { |
|
| 41 | + view()->composer(['layouts.front.category-nav'], function($view) { |
|
| 42 | 42 | $view->with('categories', $this->getCategories()); |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $list = $this->addressRepo->searchAddress(request()->input('q')); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $addresses = $list->map(function (Address $address) { |
|
| 56 | + $addresses = $list->map(function(Address $address) { |
|
| 57 | 57 | return $this->transformAddress($address); |
| 58 | 58 | })->all(); |
| 59 | 59 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | $countries = $this->countryRepo->listCountries(); |
| 117 | 117 | |
| 118 | - $country = $countries->filter(function ($country) { |
|
| 118 | + $country = $countries->filter(function($country) { |
|
| 119 | 119 | return $country == env('SHOP_COUNTRY_ID', '1'); |
| 120 | 120 | })->first(); |
| 121 | 121 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->middleware(['permission:create-product, guard:employee'], ['only' => ['create', 'store']]); |
| 83 | 83 | $this->middleware(['permission:update-product, guard:employee'], ['only' => ['edit', 'update']]); |
| 84 | 84 | $this->middleware(['permission:delete-product, guard:employee'], ['only' => ['destroy']]); |
| 85 | - $this->middleware(['permission:view-product, guard:employee'], ['only' => [ 'index', 'show']]); |
|
| 85 | + $this->middleware(['permission:view-product, guard:employee'], ['only' => ['index', 'show']]); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $list = $this->productRepo->searchProduct(request()->input('q')); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $products = $list->map(function (Product $item) { |
|
| 101 | + $products = $list->map(function(Product $item) { |
|
| 102 | 102 | return $this->transformProduct($item); |
| 103 | 103 | })->all(); |
| 104 | 104 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $product = $this->productRepo->findProductById($id); |
| 178 | 178 | $productAttributes = $product->attributes()->get(); |
| 179 | 179 | |
| 180 | - $qty = $productAttributes->map(function ($item) { |
|
| 180 | + $qty = $productAttributes->map(function($item) { |
|
| 181 | 181 | return $item->quantity; |
| 182 | 182 | })->sum(); |
| 183 | 183 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $product->categories()->sync([]); |
| 259 | 259 | $productAttr = $product->attributes(); |
| 260 | 260 | |
| 261 | - $productAttr->each(function ($pa) { |
|
| 261 | + $productAttr->each(function($pa) { |
|
| 262 | 262 | DB::table('attribute_value_product_attribute')->where('product_attribute_id', $pa->id)->delete(); |
| 263 | 263 | }); |
| 264 | 264 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | ); |
| 349 | 349 | |
| 350 | 350 | // save the combinations |
| 351 | - return collect($attributeValues)->each(function ($attributeValueId) use ($productRepo, $productAttribute) { |
|
| 351 | + return collect($attributeValues)->each(function($attributeValueId) use ($productRepo, $productAttribute) { |
|
| 352 | 352 | $attribute = $this->attributeValueRepository->find($attributeValueId); |
| 353 | 353 | return $productRepo->saveCombination($productAttribute, $attribute); |
| 354 | 354 | })->count(); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $list = $this->productRepo->listProducts(); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $products = $list->where('status', 1)->map(function (Product $item) { |
|
| 39 | + $products = $list->where('status', 1)->map(function(Product $item) { |
|
| 40 | 40 | return $this->transformProduct($item); |
| 41 | 41 | }); |
| 42 | 42 | |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // Get payment gateways |
| 118 | - $paymentGateways = collect(explode(',', config('payees.name')))->transform(function ($name) { |
|
| 118 | + $paymentGateways = collect(explode(',', config('payees.name')))->transform(function($name) { |
|
| 119 | 119 | return config($name); |
| 120 | 120 | })->all(); |
| 121 | 121 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $customerRepo = new CustomerRepository($customer); |
| 45 | 45 | $orders = $customerRepo->findOrders(['*'], 'created_at'); |
| 46 | 46 | |
| 47 | - $orders->transform(function (Order $order) { |
|
| 47 | + $orders->transform(function(Order $order) { |
|
| 48 | 48 | return $this->transformOrder($order); |
| 49 | 49 | }); |
| 50 | 50 | |