@@ -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 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'product_sku' => $product->sku, |
| 118 | 118 | 'product_description' => $product->description, |
| 119 | 119 | 'product_price' => $product->price, |
| 120 | - 'product_attribute_id' => isset($data['product_attribute_id']) ? $data['product_attribute_id']: null, |
|
| 120 | + 'product_attribute_id' => isset($data['product_attribute_id']) ? $data['product_attribute_id'] : null, |
|
| 121 | 121 | ]); |
| 122 | 122 | $product->quantity = ($product->quantity - $quantity); |
| 123 | 123 | $product->save(); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function listOrderedProducts() : Collection |
| 174 | 174 | { |
| 175 | - return $this->model->products->map(function (Product $product) { |
|
| 175 | + return $this->model->products->map(function(Product $product) { |
|
| 176 | 176 | $product->name = $product->pivot->product_name; |
| 177 | 177 | $product->sku = $product->pivot->product_sku; |
| 178 | 178 | $product->description = $product->pivot->product_description; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function buildOrderDetails(Collection $items) |
| 190 | 190 | { |
| 191 | - $items->each(function ($item) { |
|
| 191 | + $items->each(function($item) { |
|
| 192 | 192 | $productRepo = new ProductRepository(new Product); |
| 193 | 193 | $product = $productRepo->find($item->id); |
| 194 | 194 | if ($item->options->has('product_attribute_id')) { |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | // just make current category as root |
| 124 | 124 | // else we need to find the parent |
| 125 | 125 | // and associate it as child |
| 126 | - if ( (int)$params['parent'] == 0) { |
|
| 126 | + if ((int) $params['parent'] == 0) { |
|
| 127 | 127 | $category->saveAsRoot(); |
| 128 | 128 | } else { |
| 129 | 129 | $parent = $this->findCategoryById($params['parent']); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $pluralModel = str_plural($this->model); |
| 61 | 61 | |
| 62 | 62 | // Check if the model already created |
| 63 | - if ( $this->filesystem->exists(app_path("Shop/{$pluralModel}/{$this->model}.php")) ){ |
|
| 63 | + if ($this->filesystem->exists(app_path("Shop/{$pluralModel}/{$this->model}.php"))) { |
|
| 64 | 64 | return $this->error("The given model already exists!"); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | // Create Model under default instalation folder |
| 83 | 83 | $this->call('make:model', [ |
| 84 | - 'name' => 'Shop/' . $pluralModel . '/' .$this->model, |
|
| 84 | + 'name' => 'Shop/' . $pluralModel . '/' . $this->model, |
|
| 85 | 85 | '--migration' => $this->option('migration'), |
| 86 | 86 | ]); |
| 87 | 87 | } |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | // get plural from model name |
| 114 | 114 | $pluralModel = str_plural($this->model); |
| 115 | 115 | // create container folder |
| 116 | - $this->filesystem->makeDirectory(app_path($baseFolder."/{$pluralModel}")); |
|
| 116 | + $this->filesystem->makeDirectory(app_path($baseFolder . "/{$pluralModel}")); |
|
| 117 | 117 | // add requests folder |
| 118 | - $this->filesystem->makeDirectory(app_path($baseFolder."/{$pluralModel}/Requests")); |
|
| 118 | + $this->filesystem->makeDirectory(app_path($baseFolder . "/{$pluralModel}/Requests")); |
|
| 119 | 119 | // add repositories folder |
| 120 | - $this->filesystem->makeDirectory(app_path($baseFolder."/{$pluralModel}/Repositories/")); |
|
| 120 | + $this->filesystem->makeDirectory(app_path($baseFolder . "/{$pluralModel}/Repositories/")); |
|
| 121 | 121 | // add Interfaces folder |
| 122 | - $this->filesystem->makeDirectory(app_path($baseFolder."/{$pluralModel}/Repositories/Interfaces")); |
|
| 122 | + $this->filesystem->makeDirectory(app_path($baseFolder . "/{$pluralModel}/Repositories/Interfaces")); |
|
| 123 | 123 | } |
| 124 | 124 | } |
@@ -29,11 +29,11 @@ discard block |
||
| 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 | }); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | view()->composer([ |
| 45 | 45 | "layouts.admin.app" |
| 46 | - ], function ($view) { |
|
| 46 | + ], function($view) { |
|
| 47 | 47 | $breadcumb = [ |
| 48 | 48 | ["name" => "Dashboard", "url" => route("admin.dashboard"), "icon" => "fa fa-dashboard"], |
| 49 | 49 | ]; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | 66 | |
| 67 | - view()->composer(['layouts.front.category-nav'], function ($view) { |
|
| 67 | + view()->composer(['layouts.front.category-nav'], function($view) { |
|
| 68 | 68 | $view->with('categories', $this->getCategories()); |
| 69 | 69 | }); |
| 70 | 70 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | if ($validated["valid"] === true) { |
| 40 | 40 | view()->composer([ |
| 41 | 41 | "layouts.admin.app" |
| 42 | - ], function ($view) use ($data) { |
|
| 42 | + ], function($view) use ($data) { |
|
| 43 | 43 | $view->with( |
| 44 | 44 | [ |
| 45 | 45 | "breadcumbs" => $data |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | $address = $this->addressRepo->findCustomerAddressById($addressId, auth()->user()); |
| 147 | 147 | |
| 148 | 148 | if ($address->orders()->exists()) { |
| 149 | - $address->status=0; |
|
| 149 | + $address->status = 0; |
|
| 150 | 150 | $address->save(); |
| 151 | 151 | } |
| 152 | 152 | else { |
@@ -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 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | return $this->model->brand; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - public function countProducts(){ |
|
| 330 | + public function countProducts() { |
|
| 331 | 331 | return Product::count(); |
| 332 | 332 | } |
| 333 | 333 | } |