@@ -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); |
@@ -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 | |
@@ -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 | } |