@@ -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 |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function saveProductImages(Collection $collection) |
228 | 228 | { |
229 | - $collection->each(function (UploadedFile $file) { |
|
229 | + $collection->each(function(UploadedFile $file) { |
|
230 | 230 | $filename = $this->storeFile($file); |
231 | 231 | $productImage = new ProductImage([ |
232 | 232 | 'product_id' => $this->model->id, |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function saveCombination(ProductAttribute $productAttribute, AttributeValue ...$attributeValues) : Collection |
281 | 281 | { |
282 | - return collect($attributeValues)->each(function (AttributeValue $value) use ($productAttribute) { |
|
282 | + return collect($attributeValues)->each(function(AttributeValue $value) use ($productAttribute) { |
|
283 | 283 | return $productAttribute->attributesValues()->save($value); |
284 | 284 | }); |
285 | 285 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function listCombinations() : Collection |
291 | 291 | { |
292 | - return $this->model->attributes()->map(function (ProductAttribute $productAttribute) { |
|
292 | + return $this->model->attributes()->map(function(ProductAttribute $productAttribute) { |
|
293 | 293 | return $productAttribute->attributesValues; |
294 | 294 | }); |
295 | 295 | } |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | { |
303 | 303 | $values = $productAttribute->attributesValues()->get(); |
304 | 304 | |
305 | - return $values->map(function (AttributeValue $attributeValue) { |
|
305 | + return $values->map(function(AttributeValue $attributeValue) { |
|
306 | 306 | return $attributeValue; |
307 | - })->keyBy(function (AttributeValue $item) { |
|
307 | + })->keyBy(function(AttributeValue $item) { |
|
308 | 308 | return strtolower($item->attribute->name); |
309 | - })->transform(function (AttributeValue $value) { |
|
309 | + })->transform(function(AttributeValue $value) { |
|
310 | 310 | return $value->value; |
311 | 311 | }); |
312 | 312 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $list = $this->productRepo->searchProduct(request()->input('q')); |
102 | 102 | } |
103 | 103 | |
104 | - $products = $list->map(function (Product $item) { |
|
104 | + $products = $list->map(function(Product $item) { |
|
105 | 105 | return $this->transformProduct($item); |
106 | 106 | })->all(); |
107 | 107 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $product = $this->productRepo->findProductById($id); |
192 | 192 | $productAttributes = $product->attributes()->get(); |
193 | 193 | |
194 | - $qty = $productAttributes->map(function ($item) { |
|
194 | + $qty = $productAttributes->map(function($item) { |
|
195 | 195 | return $item->quantity; |
196 | 196 | })->sum(); |
197 | 197 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $product->categories()->sync([]); |
291 | 291 | $productAttr = $product->attributes(); |
292 | 292 | |
293 | - $productAttr->each(function ($pa) { |
|
293 | + $productAttr->each(function($pa) { |
|
294 | 294 | DB::table('attribute_value_product_attribute')->where('product_attribute_id', $pa->id)->delete(); |
295 | 295 | }); |
296 | 296 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | ); |
371 | 371 | |
372 | 372 | // save the combinations |
373 | - return collect($attributeValues)->each(function ($attributeValueId) use ($productRepo, $productAttribute) { |
|
373 | + return collect($attributeValues)->each(function($attributeValueId) use ($productRepo, $productAttribute) { |
|
374 | 374 | $attribute = $this->attributeValueRepository->find($attributeValueId); |
375 | 375 | return $productRepo->saveCombination($productAttribute, $attribute); |
376 | 376 | })->count(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $list = $this->addressRepo->searchAddress($request->input('q')); |
58 | 58 | } |
59 | 59 | |
60 | - $addresses = $list->map(function (Address $address) { |
|
60 | + $addresses = $list->map(function(Address $address) { |
|
61 | 61 | return $this->transformAddress($address); |
62 | 62 | })->all(); |
63 | 63 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | $countries = $this->countryRepo->listCountries(); |
121 | 121 | |
122 | - $country = $countries->filter(function ($country) { |
|
122 | + $country = $countries->filter(function($country) { |
|
123 | 123 | return $country == env('SHOP_COUNTRY_ID', '1'); |
124 | 124 | })->first(); |
125 | 125 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $rate_id = $request->input('rate'); |
62 | 62 | $rates = $shippingRepo->getRates($request->input('shipment_obj_id')); |
63 | - $rate = collect($rates->results)->filter(function ($rate) use ($rate_id) { |
|
63 | + $rate = collect($rates->results)->filter(function($rate) use ($rate_id) { |
|
64 | 64 | return $rate->object_id == $rate_id; |
65 | 65 | })->first(); |
66 | 66 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | $transaction = Shippo_Transaction::create($details); |
136 | 136 | |
137 | - if ($transaction['status'] != 'SUCCESS'){ |
|
137 | + if ($transaction['status'] != 'SUCCESS') { |
|
138 | 138 | Log::error($transaction['messages']); |
139 | 139 | return redirect()->route('checkout.index')->with('error', 'There is an error in the shipment details. Check logs.'); |
140 | 140 | } |
@@ -123,8 +123,7 @@ |
||
123 | 123 | ->addresses() |
124 | 124 | ->whereId($id) |
125 | 125 | ->firstOrFail(); |
126 | - } |
|
127 | - catch (ModelNotFoundException $e) |
|
126 | + } catch (ModelNotFoundException $e) |
|
128 | 127 | { |
129 | 128 | throw new AddressNotFoundException('Address not found.'); |
130 | 129 | } |