@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | if ($request->wantsJson()) { |
| 15 | 15 | $query = TaxRateService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 16 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) { |
|
| 16 | + $datatables = DataTables::of($query)->addColumn('action', function($query) { |
|
| 17 | 17 | $deleteLink = Form::deleteajax(url()->route('tax-rate.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $query->title); |
| 18 | 18 | $links = '<a href="'.url()->route('tax-rate.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
| 19 | 19 | return $links; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $query = AttributeService::getModel()->where('attribute_group_id', '=', $attributeGroupId); |
| 33 | 33 | |
| 34 | 34 | $datatables = DataTables::of($query) |
| 35 | - ->addColumn('action', function ($query) use ($attributeGroupId) { |
|
| 35 | + ->addColumn('action', function($query) use ($attributeGroupId) { |
|
| 36 | 36 | $deleteLink = Form::deleteajax(url()->route('attribute.destroy', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 37 | 37 | $links = ' <a href="'.url()->route('attribute.edit', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>'.$deleteLink; |
| 38 | 38 | return $links; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function store(Request $request, $attributeGroupId) |
| 66 | 66 | { |
| 67 | - $result = AttributeService::create($request->all(), $attributeGroupId); |
|
| 67 | + $result = AttributeService::create($request->all(), $attributeGroupId); |
|
| 68 | 68 | return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was inserted.'); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function update(Request $request, $attributeGroupId, $attributeId) |
| 90 | 90 | { |
| 91 | - $result = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId); |
|
| 91 | + $result = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId); |
|
| 92 | 92 | return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was updated.'); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function destroy($attributeGroupId, $attributeId) |
| 102 | 102 | { |
| 103 | - $result = AttributeService::destroy($attributeId); |
|
| 103 | + $result = AttributeService::destroy($attributeId); |
|
| 104 | 104 | |
| 105 | 105 | if ($result) { |
| 106 | 106 | Notification::success('Atrribute was deleted.'); |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $datatables = DataTables::of($image) |
| 28 | 28 | |
| 29 | - ->addColumn('thumb', function ($image) use ($productCategoryId) { |
|
| 29 | + ->addColumn('thumb', function($image) use ($productCategoryId) { |
|
| 30 | 30 | return '<img src="/files/product_category/100x100/'.$image->product_category_id.'/'.$image->file.'" />'; |
| 31 | 31 | }) |
| 32 | - ->addColumn('action', function ($image) use ($productCategoryId) { |
|
| 32 | + ->addColumn('action', function($image) use ($productCategoryId) { |
|
| 33 | 33 | $deleteLink = Form::deleteajax(url()->route('product-category.images.destroy', array('productCategoryId' => $productCategoryId, 'id' => $image->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 34 | 34 | $links = '<a href="'.url()->route('product-category.images.edit', array('productCategoryId' => $productCategoryId, 'id' => $image->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 35 | 35 | return $links; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function store(Request $request, $productCategoryId) |
| 51 | 51 | { |
| 52 | - $result = ProductCategoryService::createImage($request->all(), $productCategoryId); |
|
| 52 | + $result = ProductCategoryService::createImage($request->all(), $productCategoryId); |
|
| 53 | 53 | return ProductCategoryService::notificationRedirect(array('product-category.images.index', $productCategoryId), $result, 'The category image was inserted.'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function update(Request $request, $productCategoryId, $productCategoryImageId) |
| 63 | 63 | { |
| 64 | - $result = ProductCategoryService::updateImageById($request->all(), $productCategoryId, $productCategoryImageId); |
|
| 64 | + $result = ProductCategoryService::updateImageById($request->all(), $productCategoryId, $productCategoryImageId); |
|
| 65 | 65 | return ProductCategoryService::notificationRedirect(array('product-category.images.index', $productCategoryId), $result, 'The category image was updated.'); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function destroy($productCategoryId, $productCategoryImageId) |
| 69 | 69 | { |
| 70 | - $result = ProductCategoryService::destroyImage($productCategoryImageId); |
|
| 70 | + $result = ProductCategoryService::destroyImage($productCategoryImageId); |
|
| 71 | 71 | |
| 72 | 72 | if ($result) { |
| 73 | 73 | Notification::success('The file was deleted.'); |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | $clients = ClientService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 29 | 29 | |
| 30 | 30 | $datatables = DataTables::of($clients) |
| 31 | - ->addColumn('last_login', function ($clients) { |
|
| 31 | + ->addColumn('last_login', function($clients) { |
|
| 32 | 32 | return date('d F H:i', strtotime($clients->last_login)); |
| 33 | 33 | }) |
| 34 | - ->addColumn('action', function ($clients) { |
|
| 34 | + ->addColumn('action', function($clients) { |
|
| 35 | 35 | $deleteLink = Form::deleteajax(url()->route('client.destroy', $clients->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 36 | 36 | $links = '<a href="'.url()->route('client.edit', $clients->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$deleteLink; |
| 37 | 37 | |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | public function postActivate(Request $request, $clientId) |
| 69 | 69 | { |
| 70 | 70 | $input = $request->all(); |
| 71 | - $result = ClientService::activate($clientId); |
|
| 71 | + $result = ClientService::activate($clientId); |
|
| 72 | 72 | |
| 73 | 73 | if ($input['send_mail']) { |
| 74 | - Mail::send('frontend.email.activate-mail', array('user' => $result->toArray(), 'billAddress' => $result->clientBillAddress->toArray()), function ($message) use ($result) { |
|
| 74 | + Mail::send('frontend.email.activate-mail', array('user' => $result->toArray(), 'billAddress' => $result->clientBillAddress->toArray()), function($message) use ($result) { |
|
| 75 | 75 | $message->to($result['email'])->from('[email protected]', 'Hideyo')->subject('Toegang tot account.'); |
| 76 | 76 | }); |
| 77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function store(Request $request) |
| 93 | 93 | { |
| 94 | - $result = ClientService::create($request->all()); |
|
| 94 | + $result = ClientService::create($request->all()); |
|
| 95 | 95 | return ClientService::notificationRedirect('client.index', $result, 'The client was inserted.'); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -122,24 +122,24 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | public function postExport() |
| 124 | 124 | { |
| 125 | - $result = ClientService::selectAllExport(); |
|
| 126 | - Excel::create('export', function ($excel) use ($result) { |
|
| 125 | + $result = ClientService::selectAllExport(); |
|
| 126 | + Excel::create('export', function($excel) use ($result) { |
|
| 127 | 127 | |
| 128 | - $excel->sheet('Clients', function ($sheet) use ($result) { |
|
| 128 | + $excel->sheet('Clients', function($sheet) use ($result) { |
|
| 129 | 129 | $newArray = array(); |
| 130 | 130 | foreach ($result as $row) { |
| 131 | 131 | $firstname = null; |
| 132 | - if($row->clientBillAddress) { |
|
| 132 | + if ($row->clientBillAddress) { |
|
| 133 | 133 | $firstname = $row->clientBillAddress->firstname; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $lastname = null; |
| 137 | - if($row->clientBillAddress) { |
|
| 137 | + if ($row->clientBillAddress) { |
|
| 138 | 138 | $lastname = $row->clientBillAddress->lastname; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $gender = null; |
| 142 | - if($row->clientBillAddress) { |
|
| 142 | + if ($row->clientBillAddress) { |
|
| 143 | 143 | $gender = $row->clientBillAddress->gender; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -163,12 +163,12 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | public function update(Request $request, $clientId) |
| 165 | 165 | { |
| 166 | - $result = ClientService::updateById($request->all(), $clientId); |
|
| 166 | + $result = ClientService::updateById($request->all(), $clientId); |
|
| 167 | 167 | $input = $request->all(); |
| 168 | 168 | if (isset($result->id)) { |
| 169 | 169 | if ($result->active) { |
| 170 | 170 | if ($input['send_mail']) { |
| 171 | - Mail::send('frontend.email.activate-mail', array('user' => $result->toArray(), 'billAddress' => $result->clientBillAddress->toArray()), function ($message) use ($result) { |
|
| 171 | + Mail::send('frontend.email.activate-mail', array('user' => $result->toArray(), 'billAddress' => $result->clientBillAddress->toArray()), function($message) use ($result) { |
|
| 172 | 172 | $message->to($result['email'])->from('[email protected]', 'Hideyo')->subject('Toegang tot account.'); |
| 173 | 173 | }); |
| 174 | 174 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | public function destroy($clientId) |
| 191 | 191 | { |
| 192 | - $result = ClientService::destroy($clientId); |
|
| 192 | + $result = ClientService::destroy($clientId); |
|
| 193 | 193 | |
| 194 | 194 | if ($result) { |
| 195 | 195 | Notification::success('The client was deleted.'); |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $datatables = DataTables::of($content) |
| 38 | 38 | |
| 39 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 39 | + ->filterColumn('title', function($query, $keyword) { |
|
| 40 | 40 | $query->whereRaw("content.title like ?", ["%{$keyword}%"]); |
| 41 | 41 | }) |
| 42 | - ->addColumn('contentgroup', function ($content) { |
|
| 42 | + ->addColumn('contentgroup', function($content) { |
|
| 43 | 43 | return $content->contenttitle; |
| 44 | 44 | }) |
| 45 | - ->addColumn('action', function ($content) { |
|
| 45 | + ->addColumn('action', function($content) { |
|
| 46 | 46 | $deleteLink = Form::deleteajax(url()->route('content.destroy', $content->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 47 | 47 | $links = '<a href="'.url()->route('content.edit', $content->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 48 | 48 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function store(Request $request) |
| 64 | 64 | { |
| 65 | - $result = ContentService::create($request->all()); |
|
| 65 | + $result = ContentService::create($request->all()); |
|
| 66 | 66 | return ContentService::notificationRedirect('content.index', $result, 'The content was inserted.'); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function update(Request $request, $contentId) |
| 75 | 75 | { |
| 76 | - $result = ContentService::updateById($request->all(), $contentId); |
|
| 76 | + $result = ContentService::updateById($request->all(), $contentId); |
|
| 77 | 77 | return ContentService::notificationRedirect('content.index', $result, 'The content was updated.'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function destroy(Request $request, $contentId) |
| 81 | 81 | { |
| 82 | - $result = ContentService::destroy($contentId); |
|
| 82 | + $result = ContentService::destroy($contentId); |
|
| 83 | 83 | |
| 84 | 84 | if ($result) { |
| 85 | 85 | Notification::success('The content was deleted.'); |
@@ -27,24 +27,24 @@ discard block |
||
| 27 | 27 | $addresses = ClientService::getAddressModel()->with(array('clientDeliveryAddress', 'clientBillAddress'))->where('client_id', '=', $clientId); |
| 28 | 28 | |
| 29 | 29 | $datatables = DataTables::of($addresses) |
| 30 | - ->addColumn('housenumber', function ($addresses) { |
|
| 30 | + ->addColumn('housenumber', function($addresses) { |
|
| 31 | 31 | return $addresses->housenumber.$addresses->housenumber_suffix; |
| 32 | 32 | }) |
| 33 | - ->addColumn('delivery', function ($addresses) { |
|
| 33 | + ->addColumn('delivery', function($addresses) { |
|
| 34 | 34 | if ($addresses->clientDeliveryAddress()->count()) { |
| 35 | 35 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
| 39 | 39 | }) |
| 40 | - ->addColumn('bill', function ($addresses) { |
|
| 40 | + ->addColumn('bill', function($addresses) { |
|
| 41 | 41 | if ($addresses->clientBillAddress()->count()) { |
| 42 | 42 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
| 46 | 46 | }) |
| 47 | - ->addColumn('action', function ($addresses) use ($clientId) { |
|
| 47 | + ->addColumn('action', function($addresses) use ($clientId) { |
|
| 48 | 48 | $deleteLink = Form::deleteajax(url()->route('client.addresses.destroy', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 49 | 49 | $links = '<a href="'.url()->route('client.addresses.edit', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 50 | 50 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function store(Request $request, $clientId) |
| 67 | 67 | { |
| 68 | - $result = ClientService::createAddress($request->all(), $clientId); |
|
| 68 | + $result = ClientService::createAddress($request->all(), $clientId); |
|
| 69 | 69 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is inserted.'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function update(Request $request, $clientId, $id) |
| 79 | 79 | { |
| 80 | - $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 80 | + $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 81 | 81 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is updated.'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function destroy($clientId, $id) |
| 85 | 85 | { |
| 86 | - $result = ClientService::destroyAddress($id); |
|
| 86 | + $result = ClientService::destroyAddress($id); |
|
| 87 | 87 | |
| 88 | 88 | if ($result) { |
| 89 | 89 | Notification::success('The client address is deleted.'); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 28 | 28 | |
| 29 | 29 | $datatables = DataTables::of($query) |
| 30 | - ->addColumn('action', function ($query) { |
|
| 30 | + ->addColumn('action', function($query) { |
|
| 31 | 31 | $deleteLink = Form::deleteajax(url()->route('content-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 32 | 32 | $links = '<a href="'.url()->route('content-group.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 33 | 33 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function store(Request $request) |
| 49 | 49 | { |
| 50 | - $result = ContentService::createGroup($request->all()); |
|
| 50 | + $result = ContentService::createGroup($request->all()); |
|
| 51 | 51 | return ContentService::notificationRedirect('content-group.index', $result, 'The content group was inserted.'); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function update(Request $request, $contentGroupId) |
| 60 | 60 | { |
| 61 | - $result = ContentService::updateGroupById($request->all(), $contentGroupId); |
|
| 61 | + $result = ContentService::updateGroupById($request->all(), $contentGroupId); |
|
| 62 | 62 | return ContentService::notificationRedirect('content-group.index', $result, 'The content group was updated.'); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function destroy($contentGroupId) |
| 71 | 71 | { |
| 72 | - $result = ContentService::destroyGroup($contentGroupId); |
|
| 72 | + $result = ContentService::destroyGroup($contentGroupId); |
|
| 73 | 73 | |
| 74 | 74 | if ($result) { |
| 75 | 75 | Notification::success('The content was deleted.'); |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | $query = ProductService::getImageModel()->where('product_id', '=', $productId); |
| 25 | 25 | |
| 26 | 26 | $datatables = \DataTables::of($query) |
| 27 | - ->addColumn('thumb', function ($query) use ($productId) { |
|
| 27 | + ->addColumn('thumb', function($query) use ($productId) { |
|
| 28 | 28 | return '<img src="/files/product/100x100/'.$query->product_id.'/'.$query->file.'" />'; |
| 29 | 29 | }) |
| 30 | 30 | |
| 31 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 31 | + ->addColumn('action', function($query) use ($productId) { |
|
| 32 | 32 | $deleteLink = \Form::deleteajax(url()->route('product.images.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 33 | 33 | $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; |
| 34 | 34 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function store(Request $request, $productId) |
| 52 | 52 | { |
| 53 | - $result = ProductService::createImage($request->all(), $productId); |
|
| 53 | + $result = ProductService::createImage($request->all(), $productId); |
|
| 54 | 54 | return ProductService::notificationRedirect(array('product.images.index', $productId), $result, 'The product image was inserted.'); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if ($productImage->relatedProductAttributes->count()) { |
| 66 | 66 | foreach ($productImage->relatedProductAttributes as $row) { |
| 67 | - $selectedProductAttributes[] = $row->pivot->product_attribute_id; |
|
| 67 | + $selectedProductAttributes[] = $row->pivot->product_attribute_id; |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if ($productImage->relatedAttributes->count()) { |
| 72 | 72 | foreach ($productImage->relatedAttributes as $row) { |
| 73 | - $selectedAttributes[] = $row->pivot->attribute_id; |
|
| 73 | + $selectedAttributes[] = $row->pivot->attribute_id; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function generateAttributeLists($product) |
| 81 | 81 | { |
| 82 | - $productAttributes = $product->attributes; |
|
| 82 | + $productAttributes = $product->attributes; |
|
| 83 | 83 | $newProductAttributes = array(); |
| 84 | 84 | $attributesList = array(); |
| 85 | 85 | $productAttributesList = array(); |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function update(Request $request, $productId, $productImageId) |
| 111 | 111 | { |
| 112 | - $result = ProductService::updateImageById($request->all(), $productId, $productImageId); |
|
| 112 | + $result = ProductService::updateImageById($request->all(), $productId, $productImageId); |
|
| 113 | 113 | return ProductService::notificationRedirect(array('product.images.index', $productId), $result, 'The product image was update.'); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | public function destroy($productId, $productImageId) |
| 117 | 117 | { |
| 118 | - $result = ProductService::destroyImage($productImageId); |
|
| 118 | + $result = ProductService::destroyImage($productImageId); |
|
| 119 | 119 | |
| 120 | 120 | if ($result) { |
| 121 | 121 | Notification::success('The product image is deleted.'); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | ['product.*', |
| 30 | 30 | 'brand.title as brandtitle', |
| 31 | 31 | 'product_category.title as categorytitle'] |
| 32 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 32 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 33 | 33 | |
| 34 | 34 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 35 | 35 | |
@@ -38,23 +38,23 @@ discard block |
||
| 38 | 38 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 39 | 39 | |
| 40 | 40 | $datatables = \DataTables::of($product) |
| 41 | - ->filterColumn('reference_code', function ($query, $keyword) { |
|
| 41 | + ->filterColumn('reference_code', function($query, $keyword) { |
|
| 42 | 42 | $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 43 | 43 | }) |
| 44 | - ->filterColumn('active', function ($query, $keyword) { |
|
| 44 | + ->filterColumn('active', function($query, $keyword) { |
|
| 45 | 45 | $query->whereRaw("product.active like ?", ["%{$keyword}%"]); |
| 46 | 46 | ; |
| 47 | 47 | }) |
| 48 | 48 | |
| 49 | - ->addColumn('rank', function ($product) { |
|
| 49 | + ->addColumn('rank', function($product) { |
|
| 50 | 50 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">'; |
| 51 | 51 | |
| 52 | 52 | }) |
| 53 | 53 | |
| 54 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 54 | + ->filterColumn('title', function($query, $keyword) { |
|
| 55 | 55 | |
| 56 | 56 | $query->where( |
| 57 | - function ($query) use ($keyword) { |
|
| 57 | + function($query) use ($keyword) { |
|
| 58 | 58 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 59 | 59 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 60 | 60 | $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | ); |
| 64 | 64 | }) |
| 65 | 65 | |
| 66 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 66 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 67 | 67 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 68 | 68 | }) |
| 69 | 69 | |
| 70 | - ->addColumn('active', function ($product) { |
|
| 70 | + ->addColumn('active', function($product) { |
|
| 71 | 71 | if ($product->active) { |
| 72 | 72 | return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 73 | 73 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-remove icon-red"></span></a>'; |
| 76 | 76 | }) |
| 77 | 77 | |
| 78 | - ->addColumn('title', function ($product) { |
|
| 78 | + ->addColumn('title', function($product) { |
|
| 79 | 79 | if ($product->brand) { |
| 80 | 80 | return $product->brand->title.' | '.$product->title; |
| 81 | 81 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | }) |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - ->addColumn('amount', function ($product) { |
|
| 87 | + ->addColumn('amount', function($product) { |
|
| 88 | 88 | if ($product->attributes->count()) { |
| 89 | 89 | return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>'; |
| 90 | 90 | } |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">'; |
| 93 | 93 | }) |
| 94 | 94 | |
| 95 | - ->addColumn('image', function ($product) { |
|
| 95 | + ->addColumn('image', function($product) { |
|
| 96 | 96 | if ($product->productImages->count()) { |
| 97 | 97 | return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'" />'; |
| 98 | 98 | } |
| 99 | 99 | }) |
| 100 | - ->addColumn('price', function ($product) { |
|
| 100 | + ->addColumn('price', function($product) { |
|
| 101 | 101 | |
| 102 | 102 | $result = ""; |
| 103 | 103 | if ($product->price) { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | 'amount' => $product->amount |
| 148 | 148 | ); |
| 149 | 149 | |
| 150 | - $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 150 | + $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | if ($product->discount_value) { |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | }) |
| 160 | 160 | |
| 161 | 161 | |
| 162 | - ->addColumn('categorytitle', function ($product) { |
|
| 162 | + ->addColumn('categorytitle', function($product) { |
|
| 163 | 163 | if ($product->subcategories()->count()) { |
| 164 | 164 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 165 | 165 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | return $product->categorytitle; |
| 169 | 169 | }) |
| 170 | 170 | |
| 171 | - ->addColumn('action', function ($product) { |
|
| 171 | + ->addColumn('action', function($product) { |
|
| 172 | 172 | $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title); |
| 173 | 173 | $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>'; |
| 174 | 174 | |
@@ -191,26 +191,26 @@ discard block |
||
| 191 | 191 | ['product.*', |
| 192 | 192 | 'brand.title as brandtitle', |
| 193 | 193 | 'product_category.title as categorytitle'] |
| 194 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 194 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 195 | 195 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 196 | 196 | ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id') |
| 197 | 197 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 198 | 198 | |
| 199 | 199 | $datatables = \DataTables::of($product) |
| 200 | - ->addColumn('rank', function ($product) { |
|
| 200 | + ->addColumn('rank', function($product) { |
|
| 201 | 201 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">'; |
| 202 | 202 | }) |
| 203 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 203 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 204 | 204 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 205 | 205 | }) |
| 206 | - ->addColumn('title', function ($product) { |
|
| 206 | + ->addColumn('title', function($product) { |
|
| 207 | 207 | if ($product->brand) { |
| 208 | 208 | return $product->brand->title.' | '.$product->title; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | return $product->title; |
| 212 | 212 | }) |
| 213 | - ->addColumn('categorytitle', function ($product) { |
|
| 213 | + ->addColumn('categorytitle', function($product) { |
|
| 214 | 214 | if ($product->subcategories()->count()) { |
| 215 | 215 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 216 | 216 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | public function store(Request $request) |
| 241 | 241 | { |
| 242 | - $result = ProductService::create($request->all()); |
|
| 242 | + $result = ProductService::create($request->all()); |
|
| 243 | 243 | return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.'); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -284,10 +284,10 @@ discard block |
||
| 284 | 284 | public function postExport() |
| 285 | 285 | { |
| 286 | 286 | |
| 287 | - $result = ProductService::selectAllExport(); |
|
| 288 | - Excel::create('export', function ($excel) use ($result) { |
|
| 287 | + $result = ProductService::selectAllExport(); |
|
| 288 | + Excel::create('export', function($excel) use ($result) { |
|
| 289 | 289 | |
| 290 | - $excel->sheet('Products', function ($sheet) use ($result) { |
|
| 290 | + $excel->sheet('Products', function($sheet) use ($result) { |
|
| 291 | 291 | $newArray = array(); |
| 292 | 292 | foreach ($result as $row) { |
| 293 | 293 | $category = ""; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $i = 0; |
| 317 | 317 | foreach ($row->productImages as $image) { |
| 318 | 318 | $i++; |
| 319 | - $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 319 | + $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | public function update(Request $request, $productId) |
| 387 | 387 | { |
| 388 | 388 | $input = $request->all(); |
| 389 | - $result = ProductService::updateById($input, $productId); |
|
| 389 | + $result = ProductService::updateById($input, $productId); |
|
| 390 | 390 | |
| 391 | 391 | $redirect = redirect()->route('product.index'); |
| 392 | 392 | |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | |
| 417 | 417 | public function destroy($id) |
| 418 | 418 | { |
| 419 | - $result = ProductService::destroy($id); |
|
| 419 | + $result = ProductService::destroy($id); |
|
| 420 | 420 | |
| 421 | 421 | if ($result) { |
| 422 | 422 | Notification::success('The product was deleted.'); |