@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
| 16 | 16 | use Hideyo\Ecommerce\Framework\Services\ExtraField\ExtraFieldFacade as ExtraFieldService; |
| 17 | 17 | use Hideyo\Ecommerce\Framework\Services\Attribute\AttributeFacade as AttributeService; |
| 18 | -use Hideyo\Ecommerce\Framework\Services\TaxRate\TaxRateFacade as TaxRateService;; |
|
| 18 | +use Hideyo\Ecommerce\Framework\Services\TaxRate\TaxRateFacade as TaxRateService; ; |
|
| 19 | 19 | |
| 20 | 20 | use Request; |
| 21 | 21 | use DataTables; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | public function index($productId) |
| 27 | 27 | { |
| 28 | - $datatable = new ProductAmountOptionDatatable(); |
|
| 28 | + $datatable = new ProductAmountOptionDatatable(); |
|
| 29 | 29 | $product = $this->product->find($productId); |
| 30 | 30 | if (Request::wantsJson()) { |
| 31 | 31 | |
| 32 | 32 | $query = $this->productAmountOption->getModel()->where('product_id', '=', $productId); |
| 33 | 33 | |
| 34 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) use ($productId) { |
|
| 35 | - $deleteLink = Form::deleteajax('/admin/product/'.$productId.'/product-amount-option/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 34 | + $datatables = DataTables::of($query)->addColumn('action', function($query) use ($productId) { |
|
| 35 | + $deleteLink = Form::deleteajax('/admin/product/'.$productId.'/product-amount-option/'.$query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 36 | 36 | $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; |
| 37 | 37 | |
| 38 | 38 | return $links; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function store($productId) |
| 65 | 65 | { |
| 66 | 66 | |
| 67 | - $result = $this->productAmountOption->create(Request::all(), $productId); |
|
| 67 | + $result = $this->productAmountOption->create(Request::all(), $productId); |
|
| 68 | 68 | |
| 69 | 69 | if (isset($result->id)) { |
| 70 | 70 | flash('The product amount option is updated.'); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | public function update($productId, $id) |
| 96 | 96 | { |
| 97 | - $result = $this->productAmountOption->updateById(Request::all(), $productId, $id); |
|
| 97 | + $result = $this->productAmountOption->updateById(Request::all(), $productId, $id); |
|
| 98 | 98 | |
| 99 | 99 | if (!$result->id) { |
| 100 | 100 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | public function destroy($productId, $id) |
| 108 | 108 | { |
| 109 | - $result = $this->productAmountOption->destroy($id); |
|
| 109 | + $result = $this->productAmountOption->destroy($id); |
|
| 110 | 110 | |
| 111 | 111 | if ($result) { |
| 112 | 112 | flash('The product amount option is deleted.'); |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $datatables = DataTables::of($productCategory) |
| 28 | 28 | |
| 29 | - ->addColumn('image', function ($productCategory) { |
|
| 29 | + ->addColumn('image', function($productCategory) { |
|
| 30 | 30 | if ($productCategory->productCategoryImages->count()) { |
| 31 | 31 | return '<img src="/files/product_category/100x100/'.$productCategory->id.'/'.$productCategory->productCategoryImages->first()->file.'" />'; |
| 32 | 32 | } |
| 33 | 33 | }) |
| 34 | 34 | |
| 35 | - ->addColumn('title', function ($productCategory) { |
|
| 35 | + ->addColumn('title', function($productCategory) { |
|
| 36 | 36 | |
| 37 | 37 | $categoryTitle = $productCategory->title; |
| 38 | 38 | if ($productCategory->refProductCategory) { |
@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | return $categoryTitle; |
| 47 | 47 | }) |
| 48 | 48 | |
| 49 | - ->addColumn('products', function ($productCategory) { |
|
| 49 | + ->addColumn('products', function($productCategory) { |
|
| 50 | 50 | return $productCategory->products->count(); |
| 51 | 51 | }) |
| 52 | - ->addColumn('parent', function ($productCategory) { |
|
| 52 | + ->addColumn('parent', function($productCategory) { |
|
| 53 | 53 | |
| 54 | 54 | if ($productCategory->parent()->count()) { |
| 55 | 55 | return $productCategory->parent()->first()->title; |
| 56 | 56 | } |
| 57 | 57 | }) |
| 58 | 58 | |
| 59 | - ->addColumn('active', function ($product) { |
|
| 59 | + ->addColumn('active', function($product) { |
|
| 60 | 60 | if ($product->active) { |
| 61 | 61 | return '<a href="#" class="change-active" data-url="/admin/product-category/change-active/'.$product->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 62 | 62 | } |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | }) |
| 66 | 66 | |
| 67 | 67 | |
| 68 | - ->addColumn('seo', function ($productCategory) { |
|
| 68 | + ->addColumn('seo', function($productCategory) { |
|
| 69 | 69 | if ($productCategory->meta_title && $productCategory->meta_description) { |
| 70 | 70 | return '<i class="fa fa-check"></i>'; |
| 71 | 71 | } |
| 72 | 72 | }) |
| 73 | - ->addColumn('action', function ($productCategory) { |
|
| 73 | + ->addColumn('action', function($productCategory) { |
|
| 74 | 74 | $deleteLink = Form::deleteajax(url()->route('product-category.destroy', $productCategory->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $productCategory->title); |
| 75 | 75 | $links = '<a href="'.url()->route('product-category.edit', $productCategory->id).'" class="btn btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 76 | 76 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | public function store(Request $request) |
| 133 | 133 | { |
| 134 | - $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 134 | + $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 135 | 135 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was inserted.'); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function update(Request $request, $productCategoryId) |
| 155 | 155 | { |
| 156 | - $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 156 | + $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 157 | 157 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was updated.'); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | public function destroy($productCategoryId) |
| 161 | 161 | { |
| 162 | - $result = ProductCategoryService::destroy($productCategoryId); |
|
| 162 | + $result = ProductCategoryService::destroy($productCategoryId); |
|
| 163 | 163 | |
| 164 | 164 | if ($result) { |
| 165 | 165 | flash('Category was deleted.'); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } elseif ($parent->children()->count()) { |
| 230 | 230 | $node->makeLastChildOf($parent); |
| 231 | 231 | foreach ($parent->children()->get() as $key => $row) { |
| 232 | - $positionKey = $position - 1; |
|
| 232 | + $positionKey = $position - 1; |
|
| 233 | 233 | if ($key == $positionKey) { |
| 234 | 234 | $node->moveToRightOf($row); |
| 235 | 235 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if ($request->wantsJson()) { |
| 30 | 30 | $query = AttributeService::getGroupModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 31 | 31 | |
| 32 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) { |
|
| 32 | + $datatables = DataTables::of($query)->addColumn('action', function($query) { |
|
| 33 | 33 | $deleteLink = Form::deleteajax(url()->route('attribute-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 34 | 34 | $links = ' |
| 35 | 35 | <a href="'.url()->route('attribute.index', $query->id).'" class="btn btn-sm btn-info"><i class="entypo-pencil"></i>'.$query->attributes->count().' Attributes</a> |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function store(Request $request) |
| 53 | 53 | { |
| 54 | - $result = AttributeService::createGroup($request->all()); |
|
| 54 | + $result = AttributeService::createGroup($request->all()); |
|
| 55 | 55 | return AttributeService::notificationRedirect('attribute-group.index', $result, 'The attribute group was inserted.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function update(Request $request, $attributeGroupId) |
| 64 | 64 | { |
| 65 | - $result = AttributeService::updateGroupById($request->all(), $attributeGroupId); |
|
| 65 | + $result = AttributeService::updateGroupById($request->all(), $attributeGroupId); |
|
| 66 | 66 | return AttributeService::notificationRedirect('attribute-group.index', $result, 'The attribute group was updated.'); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public function destroy($attributeGroupId) |
| 70 | 70 | { |
| 71 | - $result = AttributeService::destroyGroup($attributeGroupId); |
|
| 71 | + $result = AttributeService::destroyGroup($attributeGroupId); |
|
| 72 | 72 | |
| 73 | 73 | if ($result) { |
| 74 | 74 | flash('Attribute group was deleted.'); |
@@ -29,20 +29,20 @@ discard block |
||
| 29 | 29 | ->with(array('newsGroup')) ->leftJoin(NewsService::getGroupModel()->getTable(), NewsService::getGroupModel()->getTable().'.id', '=', 'news_group_id'); |
| 30 | 30 | |
| 31 | 31 | $datatables = DataTables::of($query) |
| 32 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 32 | + ->filterColumn('title', function($query, $keyword) { |
|
| 33 | 33 | |
| 34 | 34 | $query->where( |
| 35 | - function ($query) use ($keyword) { |
|
| 35 | + function($query) use ($keyword) { |
|
| 36 | 36 | $query->whereRaw("news.title like ?", ["%{$keyword}%"]); |
| 37 | 37 | ; |
| 38 | 38 | } |
| 39 | 39 | ); |
| 40 | 40 | }) |
| 41 | - ->addColumn('newsgroup', function ($query) { |
|
| 41 | + ->addColumn('newsgroup', function($query) { |
|
| 42 | 42 | return $query->newstitle; |
| 43 | 43 | }) |
| 44 | 44 | |
| 45 | - ->addColumn('action', function ($query) { |
|
| 45 | + ->addColumn('action', function($query) { |
|
| 46 | 46 | $deleteLink = Form::deleteajax(url()->route('news.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 47 | 47 | $links = '<a href="'.url()->route('news.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 48 | 48 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function store(Request $request) |
| 65 | 65 | { |
| 66 | - $result = NewsService::create($request->all()); |
|
| 66 | + $result = NewsService::create($request->all()); |
|
| 67 | 67 | return NewsService::notificationRedirect('news.index', $result, 'The news item was inserted.'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function update(Request $request, $newsId) |
| 90 | 90 | { |
| 91 | - $result = NewsService::updateById($request->all(), $newsId); |
|
| 91 | + $result = NewsService::updateById($request->all(), $newsId); |
|
| 92 | 92 | return NewsService::notificationRedirect('news.index', $result, 'The news item was inserted.'); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | public function destroy($newsId) |
| 96 | 96 | { |
| 97 | - $result = NewsService::destroy($newsId); |
|
| 97 | + $result = NewsService::destroy($newsId); |
|
| 98 | 98 | |
| 99 | 99 | if ($result) { |
| 100 | 100 | flash('The news was deleted.'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | $query = ExtraFieldService::getValueModel()->where('extra_field_id', '=', $extraFieldId); |
| 23 | 23 | |
| 24 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) use ($extraFieldId) { |
|
| 24 | + $datatables = DataTables::of($query)->addColumn('action', function($query) use ($extraFieldId) { |
|
| 25 | 25 | $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')); |
| 26 | 26 | $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> |
| 27 | 27 | '.$deleteLink; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function store(Request $request, $extraFieldId) |
| 44 | 44 | { |
| 45 | - $result = ExtraFieldService::createValue($request->all(), $extraFieldId); |
|
| 45 | + $result = ExtraFieldService::createValue($request->all(), $extraFieldId); |
|
| 46 | 46 | return ExtraFieldService::notificationRedirect(array('extra-field.values.index', $extraFieldId), $result, 'The extra field was inserted.'); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function update(Request $request, $extraFieldId, $id) |
| 55 | 55 | { |
| 56 | - $result = ExtraFieldService::updateValueById($request->all(), $extraFieldId, $id); |
|
| 56 | + $result = ExtraFieldService::updateValueById($request->all(), $extraFieldId, $id); |
|
| 57 | 57 | return ExtraFieldService::notificationRedirect(array('extra-field.values.index', $extraFieldId), $result, 'The extra field was updated.'); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function destroy($extraFieldId, $id) |
| 61 | 61 | { |
| 62 | - $result = ExtraFieldService::destroyValue($id); |
|
| 62 | + $result = ExtraFieldService::destroyValue($id); |
|
| 63 | 63 | |
| 64 | 64 | if ($result) { |
| 65 | 65 | flash('Extra field was deleted.'); |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | public function index(Request $request) |
| 22 | 22 | { |
| 23 | 23 | if ($request->wantsJson()) { |
| 24 | - $query = UserService::getModel()->select(['id','email', 'username']); |
|
| 25 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) { |
|
| 24 | + $query = UserService::getModel()->select(['id', 'email', 'username']); |
|
| 25 | + $datatables = DataTables::of($query)->addColumn('action', function($query) { |
|
| 26 | 26 | $deleteLink = Form::deleteajax(url()->route('user.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 27 | 27 | $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; |
| 28 | 28 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function store(Request $request) |
| 45 | 45 | { |
| 46 | - $result = UserService::signup($request->all()); |
|
| 46 | + $result = UserService::signup($request->all()); |
|
| 47 | 47 | return UserService::notificationRedirect('user.index', $result, 'The user was inserted.'); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -60,20 +60,20 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $shop = ShopService::find($shopId); |
| 63 | - $result = UserService::updateShopProfileById($shop, $id); |
|
| 63 | + $result = UserService::updateShopProfileById($shop, $id); |
|
| 64 | 64 | flash('The shop changed.'); |
| 65 | 65 | return redirect()->route('shop.index'); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function update(Request $request, $id) |
| 69 | 69 | { |
| 70 | - $result = UserService::updateById($request->all(), $request->file('avatar'), $id); |
|
| 70 | + $result = UserService::updateById($request->all(), $request->file('avatar'), $id); |
|
| 71 | 71 | return UserService::notificationRedirect('user.index', $result, 'The user was updated.'); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function destroy($id) |
| 75 | 75 | { |
| 76 | - $result = UserService::destroy($id); |
|
| 76 | + $result = UserService::destroy($id); |
|
| 77 | 77 | |
| 78 | 78 | if ($result) { |
| 79 | 79 | flash('The user was deleted.'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | $query = GeneralSettingService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 17 | 17 | |
| 18 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) { |
|
| 18 | + $datatables = DataTables::of($query)->addColumn('action', function($query) { |
|
| 19 | 19 | $deleteLink = Form::deleteajax(url()->route('general-setting.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger')); |
| 20 | 20 | $links = '<a href="'.url()->route('general-setting.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
| 21 | 21 | return $links; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function store(Request $request) |
| 36 | 36 | { |
| 37 | - $result = GeneralSettingService::create($request->all()); |
|
| 37 | + $result = GeneralSettingService::create($request->all()); |
|
| 38 | 38 | return GeneralSettingService::notificationRedirect('general-setting.index', $result, 'The general setting was inserted.'); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function update(Request $request, $generalSettingId) |
| 47 | 47 | { |
| 48 | - $result = GeneralSettingService::updateById($request->all(), $generalSettingId); |
|
| 48 | + $result = GeneralSettingService::updateById($request->all(), $generalSettingId); |
|
| 49 | 49 | return GeneralSettingService::notificationRedirect('general-setting.index', $result, 'The general setting was updated.'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function destroy($generalSettingId) |
| 53 | 53 | { |
| 54 | - $result = GeneralSettingService::destroy($generalSettingId); |
|
| 54 | + $result = GeneralSettingService::destroy($generalSettingId); |
|
| 55 | 55 | if ($result) { |
| 56 | 56 | flash('The general setting was deleted.'); |
| 57 | 57 | return redirect()->route('general-setting.index'); |
@@ -29,12 +29,12 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | $datatables = \DataTables::of($invoice) |
| 32 | - ->addColumn('price_with_tax', function ($order) { |
|
| 32 | + ->addColumn('price_with_tax', function($order) { |
|
| 33 | 33 | $money = '€ '.$order->price_with_tax; |
| 34 | 34 | return $money; |
| 35 | 35 | }) |
| 36 | - ->addColumn('action', function ($invoice) { |
|
| 37 | - $deleteLink = \Form::deleteajax('/invoice/'. $invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 36 | + ->addColumn('action', function($invoice) { |
|
| 37 | + $deleteLink = \Form::deleteajax('/invoice/'.$invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 38 | 38 | $download = '<a href="/invoice/'.$invoice->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 39 | 39 | $links = '<a href="/invoice/'.$invoice->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$download; |
| 40 | 40 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function store(Request $request) |
| 71 | 71 | { |
| 72 | - $result = InvoiceService::create($request->all()); |
|
| 72 | + $result = InvoiceService::create($request->all()); |
|
| 73 | 73 | |
| 74 | 74 | if (isset($result->id)) { |
| 75 | 75 | flash('The invoice was inserted.'); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function update(Request $request, $invoiceId) |
| 93 | 93 | { |
| 94 | - $result = InvoiceService::updateById($request->all(), $invoiceId); |
|
| 94 | + $result = InvoiceService::updateById($request->all(), $invoiceId); |
|
| 95 | 95 | |
| 96 | 96 | if (isset($result->id)) { |
| 97 | 97 | flash('The invoice was updated.'); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public function destroy($invoiceId) |
| 106 | 106 | { |
| 107 | - $result = InvoiceService::destroy($invoiceId); |
|
| 107 | + $result = InvoiceService::destroy($invoiceId); |
|
| 108 | 108 | |
| 109 | 109 | if ($result) { |
| 110 | 110 | flash('The invoice was deleted.'); |
@@ -24,13 +24,13 @@ discard block |
||
| 24 | 24 | $query = ProductRelatedProductService::getModel()->where('product_id', '=', $productId); |
| 25 | 25 | |
| 26 | 26 | $datatables = \DataTables::of($query) |
| 27 | - ->addColumn('related', function ($query) use ($productId) { |
|
| 27 | + ->addColumn('related', function($query) use ($productId) { |
|
| 28 | 28 | return $query->RelatedProduct->title; |
| 29 | 29 | }) |
| 30 | - ->addColumn('product', function ($query) use ($productId) { |
|
| 30 | + ->addColumn('product', function($query) use ($productId) { |
|
| 31 | 31 | return $query->Product->title; |
| 32 | 32 | }) |
| 33 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 33 | + ->addColumn('action', function($query) use ($productId) { |
|
| 34 | 34 | $deleteLink = \Form::deleteajax(url()->route('product.related-product.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 35 | 35 | |
| 36 | 36 | return $deleteLink; |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function store(Request $request, $productId) |
| 53 | 53 | { |
| 54 | - $result = ProductRelatedProductService::create($request->all(), $productId); |
|
| 54 | + $result = ProductRelatedProductService::create($request->all(), $productId); |
|
| 55 | 55 | return redirect()->route('product.related-product.index', $productId); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function destroy($productId, $productRelatedProductId) |
| 59 | 59 | { |
| 60 | - $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 60 | + $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 61 | 61 | |
| 62 | 62 | if ($result) { |
| 63 | 63 | flash('The related product is deleted.'); |