@@ -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(); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $list = $this->productRepo->searchProduct(request()->input('q')); |
37 | 37 | |
38 | - $products = $list->map(function (Product $item) { |
|
38 | + $products = $list->map(function(Product $item) { |
|
39 | 39 | return $this->transformProduct($item); |
40 | 40 | })->all(); |
41 | 41 |
@@ -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 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function index() |
66 | 66 | { |
67 | - $cartItems = $this->cartRepo->getCartItems()->map(function (CartItem $item) { |
|
67 | + $cartItems = $this->cartRepo->getCartItems()->map(function(CartItem $item) { |
|
68 | 68 | $productRepo = new ProductRepository(new Product()); |
69 | 69 | $product = $productRepo->findProductById($item->id); |
70 | 70 | $item->product = $this->transformProduct($product); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | try { |
45 | 45 | |
46 | - if(!$this->validateFields($request->all())){ |
|
46 | + if (!$this->validateFields($request->all())) { |
|
47 | 47 | return redirect()->route('checkout.index') |
48 | 48 | ->withInput() |
49 | 49 | ->with('error', 'You must select the shipping and delivery address'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $options['source'] = $token; |
60 | 60 | $options['currency'] = config('cart.currency'); |
61 | 61 | |
62 | - if($result = $customerRepo->charge($charge, $options)) { |
|
62 | + if ($result = $customerRepo->charge($charge, $options)) { |
|
63 | 63 | $checkoutRepo = new CheckoutRepository; |
64 | 64 | $checkoutRepo->buildCheckoutItems([ |
65 | 65 | 'reference' => Uuid::uuid4()->toString(), |