@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | if (Request::wantsJson()) { |
| 24 | 24 | |
| 25 | 25 | $query = ProductTagGroupService::getModel() |
| 26 | - ->select(['id','tag']) |
|
| 26 | + ->select(['id', 'tag']) |
|
| 27 | 27 | ->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 28 | 28 | |
| 29 | - $datatables = \Datatables::of($query)->addColumn('action', function ($query) { |
|
| 29 | + $datatables = \Datatables::of($query)->addColumn('action', function($query) { |
|
| 30 | 30 | $deleteLink = \Form::deleteajax(url()->route('product-tag-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 31 | 31 | $links = '<a href="'.url()->route('product-tag-group.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 32 | 32 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function store() |
| 50 | 50 | { |
| 51 | - $result = ProductTagGroupService::create(\Request::all()); |
|
| 51 | + $result = ProductTagGroupService::create(\Request::all()); |
|
| 52 | 52 | return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was inserted.'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function update($productTagGroupId) |
| 66 | 66 | { |
| 67 | - $result = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId); |
|
| 67 | + $result = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId); |
|
| 68 | 68 | return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was updated.'); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | public function destroy($productTagGroupId) |
| 72 | 72 | { |
| 73 | - $result = ProductTagGroupService::destroy($productTagGroupId); |
|
| 73 | + $result = ProductTagGroupService::destroy($productTagGroupId); |
|
| 74 | 74 | |
| 75 | 75 | if ($result) { |
| 76 | 76 | Notification::success('The product group tag was deleted.'); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | ->addColumn('bill', function ($addresses) { |
| 57 | 57 | if ($addresses->clientBillAddress()->count()) { |
| 58 | - return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
|
| 58 | + return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | )->with(array('clientDeliveryAddress', 'clientBillAddress'))->where('client_id', '=', $clientId); |
| 37 | 37 | |
| 38 | 38 | $datatables = Datatables::of($addresses) |
| 39 | - ->addColumn('housenumber', function ($addresses) use ($clientId) { |
|
| 39 | + ->addColumn('housenumber', function($addresses) use ($clientId) { |
|
| 40 | 40 | return $addresses->housenumber.$addresses->housenumber_suffix; |
| 41 | 41 | }) |
| 42 | - ->addColumn('delivery', function ($addresses) { |
|
| 42 | + ->addColumn('delivery', function($addresses) { |
|
| 43 | 43 | if ($addresses->clientDeliveryAddress()->count()) { |
| 44 | 44 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 45 | 45 | } |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | }) |
| 50 | 50 | |
| 51 | - ->addColumn('bill', function ($addresses) { |
|
| 51 | + ->addColumn('bill', function($addresses) { |
|
| 52 | 52 | if ($addresses->clientBillAddress()->count()) { |
| 53 | 53 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
| 57 | 57 | }) |
| 58 | - ->addColumn('action', function ($addresses) use ($clientId) { |
|
| 58 | + ->addColumn('action', function($addresses) use ($clientId) { |
|
| 59 | 59 | $deleteLink = Form::deleteajax(url()->route('client.addresses.destroy', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 60 | 60 | $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; |
| 61 | 61 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function store(Request $request, $clientId) |
| 78 | 78 | { |
| 79 | - $result = ClientService::createAddress($request->all(), $clientId); |
|
| 79 | + $result = ClientService::createAddress($request->all(), $clientId); |
|
| 80 | 80 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is inserted.'); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function update(Request $request, $clientId, $id) |
| 90 | 90 | { |
| 91 | - $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 91 | + $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 92 | 92 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is updated.'); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | public function destroy($clientId, $id) |
| 96 | 96 | { |
| 97 | - $result = ClientService::destroyAddress($id); |
|
| 97 | + $result = ClientService::destroyAddress($id); |
|
| 98 | 98 | |
| 99 | 99 | if ($result) { |
| 100 | 100 | Notification::success('The client address is deleted.'); |
@@ -41,19 +41,19 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | $query = $this->productAmountSeries->getModel()->select( |
| 44 | - ['id', 'series_start', 'series_value', 'active','series_max'] |
|
| 44 | + ['id', 'series_start', 'series_value', 'active', 'series_max'] |
|
| 45 | 45 | )->where('product_id', '=', $productId); |
| 46 | 46 | |
| 47 | 47 | $datatables = Datatables::of($query) |
| 48 | 48 | |
| 49 | - ->addColumn('active', function ($query) { |
|
| 49 | + ->addColumn('active', function($query) { |
|
| 50 | 50 | if ($query->active) { |
| 51 | 51 | return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-remove icon-red"></span></a>'; |
| 55 | 55 | }) |
| 56 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 56 | + ->addColumn('action', function($query) use ($productId) { |
|
| 57 | 57 | $deleteLink = Form::deleteajax(url()->route('product.product-amount-series.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 58 | 58 | $links = '<a href="'.url()->route('product.product-amount-series.edit', array('productId' => $productId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 59 | 59 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function store(Request $request, $productId) |
| 88 | 88 | { |
| 89 | - $result = $this->productAmountSeries->create($request->all(), $productId); |
|
| 89 | + $result = $this->productAmountSeries->create($request->all(), $productId); |
|
| 90 | 90 | |
| 91 | 91 | if (isset($result->id)) { |
| 92 | 92 | Notification::success('The product amount series is updated.'); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public function update(Request $request, $productId, $id) |
| 118 | 118 | { |
| 119 | - $result = $this->productAmountSeries->updateById($request->all(), $productId, $id); |
|
| 119 | + $result = $this->productAmountSeries->updateById($request->all(), $productId, $id); |
|
| 120 | 120 | |
| 121 | 121 | if (!$result->id) { |
| 122 | 122 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function destroy($productId, $id) |
| 130 | 130 | { |
| 131 | - $result = $this->productAmountSeries->destroy($id); |
|
| 131 | + $result = $this->productAmountSeries->destroy($id); |
|
| 132 | 132 | |
| 133 | 133 | if ($result) { |
| 134 | 134 | Notification::success('The product amount series is deleted.'); |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | function ($query) use ($keyword) { |
| 69 | 69 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 70 | 70 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 71 | - $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
|
| 71 | + $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
|
| 72 | 72 | ; |
| 73 | 73 | } |
| 74 | 74 | ); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ['product.*', |
| 41 | 41 | 'brand.title as brandtitle', |
| 42 | 42 | 'product_category.title as categorytitle'] |
| 43 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 43 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 44 | 44 | |
| 45 | 45 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 46 | 46 | |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 50 | 50 | |
| 51 | 51 | $datatables = \Datatables::of($product) |
| 52 | - ->filterColumn('reference_code', function ($query, $keyword) { |
|
| 52 | + ->filterColumn('reference_code', function($query, $keyword) { |
|
| 53 | 53 | $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 54 | 54 | }) |
| 55 | - ->filterColumn('active', function ($query, $keyword) { |
|
| 55 | + ->filterColumn('active', function($query, $keyword) { |
|
| 56 | 56 | $query->whereRaw("product.active like ?", ["%{$keyword}%"]); |
| 57 | 57 | ; |
| 58 | 58 | }) |
| 59 | 59 | |
| 60 | - ->addColumn('rank', function ($product) { |
|
| 60 | + ->addColumn('rank', function($product) { |
|
| 61 | 61 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">'; |
| 62 | 62 | |
| 63 | 63 | }) |
| 64 | 64 | |
| 65 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 65 | + ->filterColumn('title', function($query, $keyword) { |
|
| 66 | 66 | |
| 67 | 67 | $query->where( |
| 68 | - function ($query) use ($keyword) { |
|
| 68 | + function($query) use ($keyword) { |
|
| 69 | 69 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 70 | 70 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 71 | 71 | $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | ); |
| 75 | 75 | }) |
| 76 | 76 | |
| 77 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 77 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 78 | 78 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 79 | 79 | }) |
| 80 | 80 | |
| 81 | - ->addColumn('active', function ($product) { |
|
| 81 | + ->addColumn('active', function($product) { |
|
| 82 | 82 | if ($product->active) { |
| 83 | 83 | 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>'; |
| 84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 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>'; |
| 87 | 87 | }) |
| 88 | 88 | |
| 89 | - ->addColumn('title', function ($product) { |
|
| 89 | + ->addColumn('title', function($product) { |
|
| 90 | 90 | if ($product->brand) { |
| 91 | 91 | return $product->brand->title.' | '.$product->title; |
| 92 | 92 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | }) |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - ->addColumn('amount', function ($product) { |
|
| 98 | + ->addColumn('amount', function($product) { |
|
| 99 | 99 | if ($product->attributes->count()) { |
| 100 | 100 | return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>'; |
| 101 | 101 | } |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">'; |
| 104 | 104 | }) |
| 105 | 105 | |
| 106 | - ->addColumn('image', function ($product) { |
|
| 106 | + ->addColumn('image', function($product) { |
|
| 107 | 107 | if ($product->productImages->count()) { |
| 108 | 108 | return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'" />'; |
| 109 | 109 | } |
| 110 | 110 | }) |
| 111 | - ->addColumn('price', function ($product) { |
|
| 111 | + ->addColumn('price', function($product) { |
|
| 112 | 112 | |
| 113 | 113 | $result = ""; |
| 114 | 114 | if ($product->price) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | 'amount' => $product->amount |
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | - $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 161 | + $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | if ($product->discount_value) { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | }) |
| 171 | 171 | |
| 172 | 172 | |
| 173 | - ->addColumn('categorytitle', function ($product) { |
|
| 173 | + ->addColumn('categorytitle', function($product) { |
|
| 174 | 174 | if ($product->subcategories()->count()) { |
| 175 | 175 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 176 | 176 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | return $product->categorytitle; |
| 180 | 180 | }) |
| 181 | 181 | |
| 182 | - ->addColumn('action', function ($product) { |
|
| 182 | + ->addColumn('action', function($product) { |
|
| 183 | 183 | $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title); |
| 184 | 184 | $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>'; |
| 185 | 185 | |
@@ -202,26 +202,26 @@ discard block |
||
| 202 | 202 | ['product.*', |
| 203 | 203 | 'brand.title as brandtitle', |
| 204 | 204 | 'product_category.title as categorytitle'] |
| 205 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 205 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 206 | 206 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 207 | 207 | ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id') |
| 208 | 208 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 209 | 209 | |
| 210 | 210 | $datatables = \Datatables::of($product) |
| 211 | - ->addColumn('rank', function ($product) { |
|
| 211 | + ->addColumn('rank', function($product) { |
|
| 212 | 212 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">'; |
| 213 | 213 | }) |
| 214 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 214 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 215 | 215 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 216 | 216 | }) |
| 217 | - ->addColumn('title', function ($product) { |
|
| 217 | + ->addColumn('title', function($product) { |
|
| 218 | 218 | if ($product->brand) { |
| 219 | 219 | return $product->brand->title.' | '.$product->title; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $product->title; |
| 223 | 223 | }) |
| 224 | - ->addColumn('categorytitle', function ($product) { |
|
| 224 | + ->addColumn('categorytitle', function($product) { |
|
| 225 | 225 | if ($product->subcategories()->count()) { |
| 226 | 226 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 227 | 227 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | public function store() |
| 252 | 252 | { |
| 253 | - $result = ProductService::create($this->request->all()); |
|
| 253 | + $result = ProductService::create($this->request->all()); |
|
| 254 | 254 | return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.'); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -295,10 +295,10 @@ discard block |
||
| 295 | 295 | public function postExport() |
| 296 | 296 | { |
| 297 | 297 | |
| 298 | - $result = ProductService::selectAllExport(); |
|
| 299 | - Excel::create('export', function ($excel) use ($result) { |
|
| 298 | + $result = ProductService::selectAllExport(); |
|
| 299 | + Excel::create('export', function($excel) use ($result) { |
|
| 300 | 300 | |
| 301 | - $excel->sheet('Products', function ($sheet) use ($result) { |
|
| 301 | + $excel->sheet('Products', function($sheet) use ($result) { |
|
| 302 | 302 | $newArray = array(); |
| 303 | 303 | foreach ($result as $row) { |
| 304 | 304 | $category = ""; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $i = 0; |
| 328 | 328 | foreach ($row->productImages as $image) { |
| 329 | 329 | $i++; |
| 330 | - $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 330 | + $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | { |
| 399 | 399 | |
| 400 | 400 | $input = $this->request->all(); |
| 401 | - $result = ProductService::updateById($input, $productId); |
|
| 401 | + $result = ProductService::updateById($input, $productId); |
|
| 402 | 402 | |
| 403 | 403 | $redirect = redirect()->route('product.index'); |
| 404 | 404 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | public function destroy($id) |
| 430 | 430 | { |
| 431 | - $result = ProductService::destroy($id); |
|
| 431 | + $result = ProductService::destroy($id); |
|
| 432 | 432 | |
| 433 | 433 | if ($result) { |
| 434 | 434 | Notification::success('The product was deleted.'); |
@@ -44,15 +44,15 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $datatables = \Datatables::of($invoice) |
| 46 | 46 | |
| 47 | - ->addColumn('price_with_tax', function ($order) { |
|
| 47 | + ->addColumn('price_with_tax', function($order) { |
|
| 48 | 48 | $money = '€ '.$order->price_with_tax; |
| 49 | 49 | return $money; |
| 50 | 50 | }) |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - ->addColumn('action', function ($invoice) { |
|
| 55 | - $deleteLink = \Form::deleteajax('/invoice/'. $invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 54 | + ->addColumn('action', function($invoice) { |
|
| 55 | + $deleteLink = \Form::deleteajax('/invoice/'.$invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 56 | 56 | $download = '<a href="/invoice/'.$invoice->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 57 | 57 | $links = '<a href="/invoice/'.$invoice->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$download; |
| 58 | 58 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function store() |
| 92 | 92 | { |
| 93 | - $result = $this->invoice->create(Request::all()); |
|
| 93 | + $result = $this->invoice->create(Request::all()); |
|
| 94 | 94 | |
| 95 | 95 | if (isset($result->id)) { |
| 96 | 96 | \Notification::success('The invoice was inserted.'); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function update($invoiceId) |
| 114 | 114 | { |
| 115 | - $result = $this->invoice->updateById(Request::all(), $invoiceId); |
|
| 115 | + $result = $this->invoice->updateById(Request::all(), $invoiceId); |
|
| 116 | 116 | |
| 117 | 117 | if (isset($result->id)) { |
| 118 | 118 | \Notification::success('The invoice was updated.'); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function destroy($invoiceId) |
| 127 | 127 | { |
| 128 | - $result = $this->invoice->destroy($invoiceId); |
|
| 128 | + $result = $this->invoice->destroy($invoiceId); |
|
| 129 | 129 | |
| 130 | 130 | if ($result) { |
| 131 | 131 | Notification::success('The invoice was deleted.'); |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | $query = ProductRelatedProductService::getModel()->where('product_id', '=', $productId); |
| 33 | 33 | |
| 34 | 34 | $datatables = \Datatables::of($query) |
| 35 | - ->addColumn('related', function ($query) use ($productId) { |
|
| 35 | + ->addColumn('related', function($query) use ($productId) { |
|
| 36 | 36 | return $query->RelatedProduct->title; |
| 37 | 37 | }) |
| 38 | - ->addColumn('product', function ($query) use ($productId) { |
|
| 38 | + ->addColumn('product', function($query) use ($productId) { |
|
| 39 | 39 | return $query->Product->title; |
| 40 | 40 | }) |
| 41 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 41 | + ->addColumn('action', function($query) use ($productId) { |
|
| 42 | 42 | $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')); |
| 43 | 43 | |
| 44 | 44 | return $deleteLink; |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function store($productId) |
| 62 | 62 | { |
| 63 | - $result = ProductRelatedProductService::create($this->request->all(), $productId); |
|
| 63 | + $result = ProductRelatedProductService::create($this->request->all(), $productId); |
|
| 64 | 64 | return redirect()->route('product.related-product.index', $productId); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function destroy($productId, $productRelatedProductId) |
| 68 | 68 | { |
| 69 | - $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 69 | + $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 70 | 70 | |
| 71 | 71 | if ($result) { |
| 72 | 72 | Notification::success('The related product is deleted.'); |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | if ($request->wantsJson()) { |
| 27 | 27 | |
| 28 | 28 | $productCategory = ProductCategoryService::getModel()->select( |
| 29 | - ['id', 'active','shop_id','parent_id', 'redirect_product_category_id','title', 'meta_title', 'meta_description'] |
|
| 29 | + ['id', 'active', 'shop_id', 'parent_id', 'redirect_product_category_id', 'title', 'meta_title', 'meta_description'] |
|
| 30 | 30 | )->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 31 | 31 | |
| 32 | 32 | $datatables = Datatables::of($productCategory) |
| 33 | 33 | |
| 34 | - ->addColumn('image', function ($productCategory) { |
|
| 34 | + ->addColumn('image', function($productCategory) { |
|
| 35 | 35 | if ($productCategory->productCategoryImages->count()) { |
| 36 | 36 | return '<img src="/files/product_category/100x100/'.$productCategory->id.'/'.$productCategory->productCategoryImages->first()->file.'" />'; |
| 37 | 37 | } |
| 38 | 38 | }) |
| 39 | 39 | |
| 40 | - ->addColumn('title', function ($productCategory) { |
|
| 40 | + ->addColumn('title', function($productCategory) { |
|
| 41 | 41 | |
| 42 | 42 | $categoryTitle = $productCategory->title; |
| 43 | 43 | if ($productCategory->refProductCategory) { |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | return $categoryTitle; |
| 52 | 52 | }) |
| 53 | 53 | |
| 54 | - ->addColumn('products', function ($productCategory) { |
|
| 54 | + ->addColumn('products', function($productCategory) { |
|
| 55 | 55 | return $productCategory->products->count(); |
| 56 | 56 | }) |
| 57 | - ->addColumn('parent', function ($productCategory) { |
|
| 57 | + ->addColumn('parent', function($productCategory) { |
|
| 58 | 58 | |
| 59 | 59 | if ($productCategory->parent()->count()) { |
| 60 | 60 | return $productCategory->parent()->first()->title; |
| 61 | 61 | } |
| 62 | 62 | }) |
| 63 | 63 | |
| 64 | - ->addColumn('active', function ($product) { |
|
| 64 | + ->addColumn('active', function($product) { |
|
| 65 | 65 | if ($product->active) { |
| 66 | 66 | return '<a href="#" class="change-active" data-url="/admin/product-category/change-active/'.$product->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 67 | 67 | } |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | }) |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - ->addColumn('seo', function ($productCategory) { |
|
| 73 | + ->addColumn('seo', function($productCategory) { |
|
| 74 | 74 | if ($productCategory->meta_title && $productCategory->meta_description) { |
| 75 | 75 | return '<i class="fa fa-check"></i>'; |
| 76 | 76 | } |
| 77 | 77 | }) |
| 78 | - ->addColumn('action', function ($productCategory) { |
|
| 78 | + ->addColumn('action', function($productCategory) { |
|
| 79 | 79 | $deleteLink = Form::deleteajax(url()->route('product-category.destroy', $productCategory->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $productCategory->title); |
| 80 | 80 | $links = '<a href="'.url()->route('product-category.edit', $productCategory->id).'" class="btn btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 81 | 81 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function store(Request $request) |
| 138 | 138 | { |
| 139 | - $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 139 | + $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 140 | 140 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was inserted.'); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | public function update(Request $request, $productCategoryId) |
| 162 | 162 | { |
| 163 | - $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 163 | + $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 164 | 164 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was updated.'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | public function destroy($productCategoryId) |
| 168 | 168 | { |
| 169 | - $result = ProductCategoryService::destroy($productCategoryId); |
|
| 169 | + $result = ProductCategoryService::destroy($productCategoryId); |
|
| 170 | 170 | |
| 171 | 171 | if ($result) { |
| 172 | 172 | Notification::success('Category was deleted.'); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } elseif ($parent->children()->count()) { |
| 237 | 237 | $node->makeLastChildOf($parent); |
| 238 | 238 | foreach ($parent->children()->get() as $key => $row) { |
| 239 | - $positionKey = $position - 1; |
|
| 239 | + $positionKey = $position - 1; |
|
| 240 | 240 | if ($key == $positionKey) { |
| 241 | 241 | $node->moveToRightOf($row); |
| 242 | 242 | } |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | ->select(['id', 'title', 'logo_file_name']); |
| 31 | 31 | $datatables = Datatables::of($query) |
| 32 | 32 | |
| 33 | - ->addColumn('action', function ($query) { |
|
| 33 | + ->addColumn('action', function($query) { |
|
| 34 | 34 | $deleteLink = Form::deleteajax(url()->route('shop.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 35 | 35 | $links = '<a href="'.url()->route('shop.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 36 | 36 | return $links; |
| 37 | 37 | }) |
| 38 | 38 | |
| 39 | - ->addColumn('image', function ($query) { |
|
| 39 | + ->addColumn('image', function($query) { |
|
| 40 | 40 | if ($query->logo_file_name) { |
| 41 | 41 | return '<img src="http://shop.brulo.nl/files/'.$query->id.'/logo/'.$query->logo_file_name.'" />'; |
| 42 | 42 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function store() |
| 57 | 57 | { |
| 58 | - $result = ShopService::create($this->request->all()); |
|
| 58 | + $result = ShopService::create($this->request->all()); |
|
| 59 | 59 | return ShopService::notificationRedirect('shop.index', $result, 'The shop was inserted.'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function update($shopId) |
| 68 | 68 | { |
| 69 | - $result = ShopService::updateById($this->request->all(), $shopId); |
|
| 69 | + $result = ShopService::updateById($this->request->all(), $shopId); |
|
| 70 | 70 | return ShopService::notificationRedirect('shop.index', $result, 'The shop was updated.'); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function destroy($shopId) |
| 74 | 74 | { |
| 75 | - $result = ShopService::destroy($shopId); |
|
| 75 | + $result = ShopService::destroy($shopId); |
|
| 76 | 76 | |
| 77 | 77 | if ($result) { |
| 78 | 78 | Notification::success('The shop was deleted.'); |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | if ($request->wantsJson()) { |
| 26 | 26 | |
| 27 | 27 | $image = ProductCategoryService::getImageModel()->select( |
| 28 | - ['id','file', 'product_category_id'] |
|
| 28 | + ['id', 'file', 'product_category_id'] |
|
| 29 | 29 | )->where('product_category_id', '=', $productCategoryId); |
| 30 | 30 | |
| 31 | 31 | $datatables = Datatables::of($image) |
| 32 | 32 | |
| 33 | - ->addColumn('thumb', function ($image) use ($productCategoryId) { |
|
| 33 | + ->addColumn('thumb', function($image) use ($productCategoryId) { |
|
| 34 | 34 | return '<img src="/files/product_category/100x100/'.$image->product_category_id.'/'.$image->file.'" />'; |
| 35 | 35 | }) |
| 36 | - ->addColumn('action', function ($image) use ($productCategoryId) { |
|
| 36 | + ->addColumn('action', function($image) use ($productCategoryId) { |
|
| 37 | 37 | $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')); |
| 38 | 38 | $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; |
| 39 | 39 | return $links; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function store(Request $request, $productCategoryId) |
| 59 | 59 | { |
| 60 | - $result = ProductCategoryService::createImage($request->all(), $productCategoryId); |
|
| 60 | + $result = ProductCategoryService::createImage($request->all(), $productCategoryId); |
|
| 61 | 61 | return ProductCategoryService::notificationRedirect(array('product-category.images.index', $productCategoryId), $result, 'The category image was inserted.'); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function update(Request $request, $productCategoryId, $productCategoryImageId) |
| 71 | 71 | { |
| 72 | - $result = ProductCategoryService::updateImageById($request->all(), $productCategoryId, $productCategoryImageId); |
|
| 72 | + $result = ProductCategoryService::updateImageById($request->all(), $productCategoryId, $productCategoryImageId); |
|
| 73 | 73 | return ProductCategoryService::notificationRedirect(array('product-category.images.index', $productCategoryId), $result, 'The category image was updated.'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | public function destroy($productCategoryId, $productCategoryImageId) |
| 77 | 77 | { |
| 78 | - $result = ProductCategoryService::destroyImage($productCategoryImageId); |
|
| 78 | + $result = ProductCategoryService::destroyImage($productCategoryImageId); |
|
| 79 | 79 | |
| 80 | 80 | if ($result) { |
| 81 | 81 | Notification::success('The file was deleted.'); |