@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $list = $this->customerRepo->searchCustomer(request()->input('q')); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - $customers = $list->map(function (Customer $customer) { |
|
| 44 | + $customers = $list->map(function(Customer $customer) { |
|
| 45 | 45 | return $this->transformCustomer($customer); |
| 46 | 46 | })->all(); |
| 47 | 47 | |
@@ -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 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $countries = $this->countryRepo->listCountries(); |
| 123 | 123 | |
| 124 | - $country = $countries->filter(function ($country) { |
|
| 124 | + $country = $countries->filter(function($country) { |
|
| 125 | 125 | return $country == env('COUNTRY_ID', 1); |
| 126 | 126 | })->first(); |
| 127 | 127 | |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | $customerRepo = new CustomerRepository(new Customer()); |
| 117 | 117 | $orderStatusRepo = new OrderStatusRepository(new OrderStatus()); |
| 118 | 118 | |
| 119 | - return $list->transform(function (Order $order) use ($courierRepo, $customerRepo, $orderStatusRepo) { |
|
| 119 | + return $list->transform(function(Order $order) use ($courierRepo, $customerRepo, $orderStatusRepo) { |
|
| 120 | 120 | $order->courier = $courierRepo->findCourierById($order->courier_id); |
| 121 | 121 | $order->customer = $customerRepo->findCustomerById($order->customer_id); |
| 122 | 122 | $order->status = $orderStatusRepo->findOrderStatusById($order->order_status_id); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $list = $this->productRepo->searchProduct(request()->input('q')); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $products = $list->map(function (Product $item) { |
|
| 85 | + $products = $list->map(function(Product $item) { |
|
| 86 | 86 | return $this->transformProduct($item); |
| 87 | 87 | })->all(); |
| 88 | 88 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | $product = $this->productRepo->findProductById($id); |
| 155 | 155 | $productAttributes = $product->attributes()->get(); |
| 156 | - $qty = $productAttributes->map(function ($item) { |
|
| 156 | + $qty = $productAttributes->map(function($item) { |
|
| 157 | 157 | return $item->quantity; |
| 158 | 158 | })->sum(); |
| 159 | 159 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $productAttribute = $productRepo->saveProductAttributes(new ProductAttribute(compact('quantity', 'price'))); |
| 289 | 289 | |
| 290 | 290 | // save the combinations |
| 291 | - return collect($attributeValues)->each(function ($attributeId) use ($productRepo, $productAttribute) { |
|
| 291 | + return collect($attributeValues)->each(function($attributeId) use ($productRepo, $productAttribute) { |
|
| 292 | 292 | $attribute = $this->attributeValueRepository->find($attributeId); |
| 293 | 293 | return $productRepo->saveCombination($productAttribute, $attribute); |
| 294 | 294 | })->count(); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $customerRepo = new CustomerRepository($customer); |
| 32 | 32 | $orders = $customerRepo->findOrders(); |
| 33 | 33 | |
| 34 | - $orders->transform(function (Order $order) { |
|
| 34 | + $orders->transform(function(Order $order) { |
|
| 35 | 35 | return $this->transformOrder($order); |
| 36 | 36 | }); |
| 37 | 37 | |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $paymentMethods = config('payees.name'); |
| 80 | 80 | $payees = explode(',', $paymentMethods); |
| 81 | 81 | |
| 82 | - $paymentGateways = collect($payees)->transform(function ($name) { |
|
| 82 | + $paymentGateways = collect($payees)->transform(function($name) { |
|
| 83 | 83 | return config($name); |
| 84 | 84 | })->filter()->all(); |
| 85 | 85 | |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | public function buildOrderDetails(Order $order, Collection $collection) |
| 47 | 47 | { |
| 48 | - $collection->each(function ($item) use ($order) { |
|
| 48 | + $collection->each(function($item) use ($order) { |
|
| 49 | 49 | $productRepo = new ProductRepository(new Product()); |
| 50 | 50 | $product = $productRepo->find($item->id); |
| 51 | 51 | |
@@ -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 | |