@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | 'value'] |
| 34 | 34 | )->where('extra_field_id', '=', $extraFieldId); |
| 35 | 35 | |
| 36 | - $datatables = Datatables::of($query)->addColumn('action', function ($query) use ($extraFieldId) { |
|
| 36 | + $datatables = Datatables::of($query)->addColumn('action', function($query) use ($extraFieldId) { |
|
| 37 | 37 | $deleteLink = Form::deleteajax(url()->route('extra-field.values.destroy', array('ExtraFieldId' => $extraFieldId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 38 | 38 | $links = ' <a href="'.url()->route('extra-field.values.edit', array('ExtraFieldId' => $extraFieldId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> |
| 39 | 39 | '.$deleteLink; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function store($extraFieldId) |
| 56 | 56 | { |
| 57 | - $result = ExtraFieldService::createValue($this->request->all(), $extraFieldId); |
|
| 57 | + $result = ExtraFieldService::createValue($this->request->all(), $extraFieldId); |
|
| 58 | 58 | return ExtraFieldService::notificationRedirect(array('extra-field.values.index', $extraFieldId), $result, 'The extra field was inserted.'); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function update($extraFieldId, $id) |
| 67 | 67 | { |
| 68 | - $result = ExtraFieldService::updateValueById($this->request->all(), $extraFieldId, $id); |
|
| 68 | + $result = ExtraFieldService::updateValueById($this->request->all(), $extraFieldId, $id); |
|
| 69 | 69 | return ExtraFieldService::notificationRedirect(array('extra-field.values.index', $extraFieldId), $result, 'The extra field was updated.'); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function destroy($extraFieldId, $id) |
| 73 | 73 | { |
| 74 | - $result = ExtraFieldService::destroyValue($id); |
|
| 74 | + $result = ExtraFieldService::destroyValue($id); |
|
| 75 | 75 | |
| 76 | 76 | if ($result) { |
| 77 | 77 | Notification::success('Extra field was deleted.'); |
@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function index($productId) |
| 40 | 40 | { |
| 41 | - $datatable = new ProductAmountOptionDatatable(); |
|
| 41 | + $datatable = new ProductAmountOptionDatatable(); |
|
| 42 | 42 | $product = $this->product->find($productId); |
| 43 | 43 | if (Request::wantsJson()) { |
| 44 | 44 | |
| 45 | 45 | $query = $this->productAmountOption->getModel()->select( |
| 46 | - ['id', 'amount','default_on'] |
|
| 46 | + ['id', 'amount', 'default_on'] |
|
| 47 | 47 | )->where('product_id', '=', $productId); |
| 48 | 48 | |
| 49 | - $datatables = Datatables::of($query)->addColumn('action', function ($query) use ($productId) { |
|
| 50 | - $deleteLink = Form::deleteajax('/admin/product/'.$productId.'/product-amount-option/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 49 | + $datatables = Datatables::of($query)->addColumn('action', function($query) use ($productId) { |
|
| 50 | + $deleteLink = Form::deleteajax('/admin/product/'.$productId.'/product-amount-option/'.$query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 51 | 51 | $links = '<a href="/admin/product/'.$productId.'/product-amount-option/'.$query->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 52 | 52 | |
| 53 | 53 | return $links; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | public function store($productId) |
| 80 | 80 | { |
| 81 | 81 | |
| 82 | - $result = $this->productAmountOption->create(Request::all(), $productId); |
|
| 82 | + $result = $this->productAmountOption->create(Request::all(), $productId); |
|
| 83 | 83 | |
| 84 | 84 | if (isset($result->id)) { |
| 85 | 85 | Notification::success('The product amount option is updated.'); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function update($productId, $id) |
| 111 | 111 | { |
| 112 | 112 | |
| 113 | - $result = $this->productAmountOption->updateById(Request::all(), $productId, $id); |
|
| 113 | + $result = $this->productAmountOption->updateById(Request::all(), $productId, $id); |
|
| 114 | 114 | |
| 115 | 115 | if (!$result->id) { |
| 116 | 116 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | public function destroy($productId, $id) |
| 124 | 124 | { |
| 125 | - $result = $this->productAmountOption->destroy($id); |
|
| 125 | + $result = $this->productAmountOption->destroy($id); |
|
| 126 | 126 | |
| 127 | 127 | if ($result) { |
| 128 | 128 | Notification::success('The product amount option is deleted.'); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | ->addColumn('status', function ($order) { |
| 48 | 48 | if ($order->orderStatus) { |
| 49 | - return $order->orderStatus->title; |
|
| 49 | + return $order->orderStatus->title; |
|
| 50 | 50 | } |
| 51 | 51 | }) |
| 52 | 52 | |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $datatables = Datatables::of($order) |
| 46 | 46 | |
| 47 | - ->addColumn('status', function ($order) { |
|
| 47 | + ->addColumn('status', function($order) { |
|
| 48 | 48 | if ($order->orderStatus) { |
| 49 | 49 | return $order->orderStatus->title; |
| 50 | 50 | } |
| 51 | 51 | }) |
| 52 | 52 | |
| 53 | - ->addColumn('created_at', function ($order) { |
|
| 53 | + ->addColumn('created_at', function($order) { |
|
| 54 | 54 | return date('d F H:i', strtotime($order->created_at)); |
| 55 | 55 | }) |
| 56 | - ->addColumn('status', function ($order) { |
|
| 56 | + ->addColumn('status', function($order) { |
|
| 57 | 57 | if ($order->orderStatus) { |
| 58 | 58 | if ($order->orderStatus->color) { |
| 59 | 59 | return '<a href="/admin/order/'.$order->id.'" style="text-decoration:none;"><span style="background-color:'.$order->orderStatus->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$order->orderStatus->title.'</span></a>'; |
@@ -61,33 +61,33 @@ discard block |
||
| 61 | 61 | return $order->orderStatus->title; |
| 62 | 62 | } |
| 63 | 63 | }) |
| 64 | - ->addColumn('client', function ($order) { |
|
| 64 | + ->addColumn('client', function($order) { |
|
| 65 | 65 | if ($order->client) { |
| 66 | 66 | if ($order->orderBillAddress) { |
| 67 | 67 | return $order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname; |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | }) |
| 71 | - ->addColumn('products', function ($order) { |
|
| 71 | + ->addColumn('products', function($order) { |
|
| 72 | 72 | if ($order->products) { |
| 73 | 73 | return $order->products->count(); |
| 74 | 74 | } |
| 75 | 75 | }) |
| 76 | - ->addColumn('price_with_tax', function ($order) { |
|
| 76 | + ->addColumn('price_with_tax', function($order) { |
|
| 77 | 77 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
| 78 | 78 | return $money; |
| 79 | 79 | }) |
| 80 | - ->addColumn('paymentMethod', function ($order) { |
|
| 80 | + ->addColumn('paymentMethod', function($order) { |
|
| 81 | 81 | if ($order->orderPaymentMethod) { |
| 82 | 82 | return $order->orderPaymentMethod->title; |
| 83 | 83 | } |
| 84 | 84 | }) |
| 85 | - ->addColumn('sendingMethod', function ($order) { |
|
| 85 | + ->addColumn('sendingMethod', function($order) { |
|
| 86 | 86 | if ($order->orderSendingMethod) { |
| 87 | 87 | return $order->orderSendingMethod->title; |
| 88 | 88 | } |
| 89 | 89 | }) |
| 90 | - ->addColumn('action', function ($order) { |
|
| 90 | + ->addColumn('action', function($order) { |
|
| 91 | 91 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 92 | 92 | $links = '<a href="/admin/order/'.$order->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$download; |
| 93 | 93 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | public function index() |
| 24 | 24 | { |
| 25 | 25 | if (Request::wantsJson()) { |
| 26 | - $query = UserService::getModel()->select(['id','email', 'username']); |
|
| 27 | - $datatables = \Datatables::of($query)->addColumn('action', function ($query) { |
|
| 26 | + $query = UserService::getModel()->select(['id', 'email', 'username']); |
|
| 27 | + $datatables = \Datatables::of($query)->addColumn('action', function($query) { |
|
| 28 | 28 | $deleteLink = \Form::deleteajax(url()->route('user.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 29 | 29 | $links = '<a href="'.url()->route('user.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 30 | 30 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function store() |
| 47 | 47 | { |
| 48 | - $result = UserService::signup(Request::all()); |
|
| 48 | + $result = UserService::signup(Request::all()); |
|
| 49 | 49 | return UserService::notificationRedirect('user.index', $result, 'The user was inserted.'); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $shop = ShopService::find($shopId); |
| 76 | - $result = UserService::updateShopProfileById($shop, $id); |
|
| 76 | + $result = UserService::updateShopProfileById($shop, $id); |
|
| 77 | 77 | Notification::success('The shop changed.'); |
| 78 | 78 | return redirect()->route('shop.index'); |
| 79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $id = auth()->id(); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - $result = UserService::updateProfileById(Request::all(), Request::file('avatar'), $id); |
|
| 87 | + $result = UserService::updateProfileById(Request::all(), Request::file('avatar'), $id); |
|
| 88 | 88 | return UserService::notificationRedirect('user.index', $result, 'The user was updated.'); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | public function update($id) |
| 108 | 108 | { |
| 109 | - $result = UserService::updateById(Request::all(), Request::file('avatar'), $id); |
|
| 109 | + $result = UserService::updateById(Request::all(), Request::file('avatar'), $id); |
|
| 110 | 110 | return UserService::notificationRedirect('user.index', $result, 'The user was updated.'); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | public function destroy($id) |
| 114 | 114 | { |
| 115 | - $result = UserService::destroy($id); |
|
| 115 | + $result = UserService::destroy($id); |
|
| 116 | 116 | |
| 117 | 117 | if ($result) { |
| 118 | 118 | Notification::success('The user was deleted.'); |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $datatables = Datatables::of($image) |
| 36 | 36 | |
| 37 | - ->addColumn('thumb', function ($image) use ($newsId) { |
|
| 37 | + ->addColumn('thumb', function($image) use ($newsId) { |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | return '<img src="/files/news/100x100/'.$image->news_id.'/'.$image->file.'" />'; |
| 41 | 41 | }) |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - ->addColumn('action', function ($image) use ($newsId) { |
|
| 44 | + ->addColumn('action', function($image) use ($newsId) { |
|
| 45 | 45 | $deleteLink = Form::deleteajax(url()->route('news-images.destroy', array('newsId' => $newsId, 'id' => $image->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 46 | 46 | $links = '<a href="'.url()->route('news-images.edit', array('newsId' => $newsId, 'id' => $image->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 47 | 47 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function store($newsId) |
| 64 | 64 | { |
| 65 | - $result = NewsService::createImage($this->request->all(), $newsId); |
|
| 65 | + $result = NewsService::createImage($this->request->all(), $newsId); |
|
| 66 | 66 | return NewsService::notificationRedirect(array('news-images.index', $newsId), $result, 'The news image was inserted.'); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | public function update($newsId, $newsImageId) |
| 76 | 76 | { |
| 77 | - $result = NewsService::updateImageById($this->request->all(), $newsId, $newsImageId); |
|
| 77 | + $result = NewsService::updateImageById($this->request->all(), $newsId, $newsImageId); |
|
| 78 | 78 | return NewsService::notificationRedirect(array('news-images.index', $newsId), $result, 'The news image was updated.'); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function destroy($newsId, $newsImageId) |
| 82 | 82 | { |
| 83 | - $result = NewsService::destroyImage($newsImageId); |
|
| 83 | + $result = NewsService::destroyImage($newsImageId); |
|
| 84 | 84 | |
| 85 | 85 | if ($result) { |
| 86 | 86 | Notification::success('The file was deleted.'); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | 'name'] |
| 37 | 37 | )->where('sending_method_id', '=', $sendingMethodId); |
| 38 | 38 | |
| 39 | - $datatables = \Datatables::of($users)->addColumn('action', function ($users) use ($sendingMethodId) { |
|
| 39 | + $datatables = \Datatables::of($users)->addColumn('action', function($users) use ($sendingMethodId) { |
|
| 40 | 40 | $delete = \Form::deleteajax(url()->route('sending-method.country-prices.destroy', array('sendingMethodId' => $sendingMethodId, 'id' => $users->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 41 | 41 | $link = '<a href="'.url()->route('sending-method.country-prices.edit', array('sendingMethodId' => $sendingMethodId, 'id' => $users->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$delete; |
| 42 | 42 | |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | $countries = \Excel::load($file, function($reader) { |
| 72 | 72 | })->get(); |
| 73 | 73 | |
| 74 | - if($countries) { |
|
| 75 | - $result = SendingMethodService::importCountries($countries, $this->request->get('tax_rate_id'), $sendingMethodId); |
|
| 74 | + if ($countries) { |
|
| 75 | + $result = SendingMethodService::importCountries($countries, $this->request->get('tax_rate_id'), $sendingMethodId); |
|
| 76 | 76 | Notification::success('The countries are inserted.'); |
| 77 | 77 | return redirect()->route('sending-method.country-prices.index', $sendingMethodId); |
| 78 | 78 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function store($sendingMethodId) |
| 82 | 82 | { |
| 83 | - $result = SendingMethodService::createCountry($this->request->all(), $sendingMethodId); |
|
| 83 | + $result = SendingMethodService::createCountry($this->request->all(), $sendingMethodId); |
|
| 84 | 84 | return SendingMethodService::notificationRedirect(array('sending-method.country-prices.index', $sendingMethodId), $result, 'The country was inserted.'); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | public function update($sendingMethodId, $id) |
| 97 | 97 | { |
| 98 | - $result = SendingMethodService::updateCountryById($this->request->all(), $id); |
|
| 98 | + $result = SendingMethodService::updateCountryById($this->request->all(), $id); |
|
| 99 | 99 | return SendingMethodService::notificationRedirect(array('sending-method.country-prices.index', $sendingMethodId), $result, 'The country was updated.'); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | public function destroy($sendingMethodId, $id) |
| 103 | 103 | { |
| 104 | - $result = SendingMethodService::destroyCountry($id); |
|
| 104 | + $result = SendingMethodService::destroyCountry($id); |
|
| 105 | 105 | |
| 106 | 106 | if ($result) { |
| 107 | 107 | Notification::success('The country price was deleted.'); |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $datatables = Datatables::of($image) |
| 39 | 39 | |
| 40 | - ->addColumn('thumb', function ($image) use ($contentId) { |
|
| 40 | + ->addColumn('thumb', function($image) use ($contentId) { |
|
| 41 | 41 | return '<img src="/files/content/100x100/'.$image->content_id.'/'.$image->file.'" />'; |
| 42 | 42 | }) |
| 43 | - ->addColumn('action', function ($image) use ($contentId) { |
|
| 44 | - $deleteLink = Form::deleteajax('/admin/content/'.$contentId.'/images/'. $image->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 43 | + ->addColumn('action', function($image) use ($contentId) { |
|
| 44 | + $deleteLink = Form::deleteajax('/admin/content/'.$contentId.'/images/'.$image->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 45 | 45 | $links = '<a href="/admin/content/'.$contentId.'/images/'.$image->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 46 | 46 | |
| 47 | 47 | return $links; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function store($contentId) |
| 63 | 63 | { |
| 64 | - $result = ContentService::createImage($this->request->all(), $contentId); |
|
| 64 | + $result = ContentService::createImage($this->request->all(), $contentId); |
|
| 65 | 65 | return ContentService::notificationRedirect(array('content.{contentId}.images.index', $contentId), $result, 'The content image was inserted.'); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function update($contentId, $contentImageId) |
| 75 | 75 | { |
| 76 | - $result = ContentService::updateImageById($this->request->all(), $contentId, $contentImageId); |
|
| 76 | + $result = ContentService::updateImageById($this->request->all(), $contentId, $contentImageId); |
|
| 77 | 77 | return ContentService::notificationRedirect(array('content.{contentId}.images.index', $contentId), $result, 'The content image was updated.'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function destroy($contentId, $contentImageId) |
| 81 | 81 | { |
| 82 | - $result = ContentService::destroyImage($contentImageId); |
|
| 82 | + $result = ContentService::destroyImage($contentImageId); |
|
| 83 | 83 | |
| 84 | 84 | if ($result) { |
| 85 | 85 | Notification::success('The file was deleted.'); |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | if ($request->wantsJson()) { |
| 31 | 31 | |
| 32 | 32 | $query = AttributeService::getGroupModel() |
| 33 | - ->select(['id','title']) |
|
| 33 | + ->select(['id', 'title']) |
|
| 34 | 34 | ->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 35 | 35 | |
| 36 | - $datatables = Datatables::of($query)->addColumn('action', function ($query) { |
|
| 36 | + $datatables = Datatables::of($query)->addColumn('action', function($query) { |
|
| 37 | 37 | $deleteLink = Form::deleteajax(url()->route('attribute-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 38 | 38 | $links = ' |
| 39 | 39 | <a href="'.url()->route('attribute.index', $query->id).'" class="btn btn-sm btn-info"><i class="entypo-pencil"></i>'.$query->attributes->count().' Attributes</a> |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function store(Request $request) |
| 57 | 57 | { |
| 58 | - $result = AttributeService::createGroup($request->all()); |
|
| 58 | + $result = AttributeService::createGroup($request->all()); |
|
| 59 | 59 | return AttributeService::notificationRedirect('attribute-group.index', $result, 'The attribute group was inserted.'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function update(Request $request, $attributeGroupId) |
| 68 | 68 | { |
| 69 | - $result = AttributeService::updateGroupById($request->all(), $attributeGroupId); |
|
| 69 | + $result = AttributeService::updateGroupById($request->all(), $attributeGroupId); |
|
| 70 | 70 | return AttributeService::notificationRedirect('attribute-group.index', $result, 'The attribute group was updated.'); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function destroy($attributeGroupId) |
| 74 | 74 | { |
| 75 | - $result = AttributeService::destroyGroup($attributeGroupId); |
|
| 75 | + $result = AttributeService::destroyGroup($attributeGroupId); |
|
| 76 | 76 | |
| 77 | 77 | if ($result) { |
| 78 | 78 | Notification::success('Attribute group was deleted.'); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function index($productId) |
| 25 | 25 | { |
| 26 | - $product = ProductService::find($productId); |
|
| 26 | + $product = ProductService::find($productId); |
|
| 27 | 27 | if ($this->request->wantsJson()) { |
| 28 | 28 | |
| 29 | 29 | $query = ProductService::getImageModel()->where('product_id', '=', $productId); |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | foreach ($newProductAttributes as $key => $productAttribute) { |
| 102 | 102 | $newArray = array(); |
| 103 | 103 | foreach ($productAttribute as $keyNew => $valueNew) { |
| 104 | - $newArray[] = $keyNew.': '.$valueNew['value']; |
|
| 105 | - $attributesList[$valueNew['id']] = $valueNew['value']; |
|
| 104 | + $newArray[] = $keyNew.': '.$valueNew['value']; |
|
| 105 | + $attributesList[$valueNew['id']] = $valueNew['value']; |
|
| 106 | 106 | } |
| 107 | 107 | $productAttributesList[$key] = implode(', ', $newArray); |
| 108 | 108 | } |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | $query = ProductService::getImageModel()->where('product_id', '=', $productId); |
| 30 | 30 | |
| 31 | 31 | $datatables = \Datatables::of($query) |
| 32 | - ->addColumn('thumb', function ($query) use ($productId) { |
|
| 32 | + ->addColumn('thumb', function($query) use ($productId) { |
|
| 33 | 33 | return '<img src="/files/product/100x100/'.$query->product_id.'/'.$query->file.'" />'; |
| 34 | 34 | }) |
| 35 | 35 | |
| 36 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 36 | + ->addColumn('action', function($query) use ($productId) { |
|
| 37 | 37 | $deleteLink = \Form::deleteajax(url()->route('product.images.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 38 | 38 | $links = '<a href="'.url()->route('product.images.edit', array('productId' => $productId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 39 | 39 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function store($productId) |
| 57 | 57 | { |
| 58 | - $result = ProductService::createImage($this->request->all(), $productId); |
|
| 58 | + $result = ProductService::createImage($this->request->all(), $productId); |
|
| 59 | 59 | return ProductService::notificationRedirect(array('product.images.index', $productId), $result, 'The product image was inserted.'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if ($productImage->relatedProductAttributes->count()) { |
| 71 | 71 | foreach ($productImage->relatedProductAttributes as $row) { |
| 72 | - $selectedProductAttributes[] = $row->pivot->product_attribute_id; |
|
| 72 | + $selectedProductAttributes[] = $row->pivot->product_attribute_id; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if ($productImage->relatedAttributes->count()) { |
| 77 | 77 | foreach ($productImage->relatedAttributes as $row) { |
| 78 | - $selectedAttributes[] = $row->pivot->attribute_id; |
|
| 78 | + $selectedAttributes[] = $row->pivot->attribute_id; |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function generateAttributeLists($product) |
| 86 | 86 | { |
| 87 | - $productAttributes = $product->attributes; |
|
| 87 | + $productAttributes = $product->attributes; |
|
| 88 | 88 | $newProductAttributes = array(); |
| 89 | 89 | $attributesList = array(); |
| 90 | 90 | $productAttributesList = array(); |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | public function update($productId, $productImageId) |
| 116 | 116 | { |
| 117 | - $result = ProductService::updateImageById($this->request->all(), $productId, $productImageId); |
|
| 117 | + $result = ProductService::updateImageById($this->request->all(), $productId, $productImageId); |
|
| 118 | 118 | return ProductService::notificationRedirect(array('product.images.index', $productId), $result, 'The product image was update.'); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public function destroy($productId, $productImageId) |
| 122 | 122 | { |
| 123 | - $result = ProductService::destroyImage($productImageId); |
|
| 123 | + $result = ProductService::destroyImage($productImageId); |
|
| 124 | 124 | |
| 125 | 125 | if ($result) { |
| 126 | 126 | Notification::success('The product image is deleted.'); |