@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | $query = ProductRelatedProductService::getModel()->where('product_id', '=', $productId); |
| 28 | 28 | |
| 29 | 29 | $datatables = \Datatables::of($query) |
| 30 | - ->addColumn('related', function ($query) use ($productId) { |
|
| 30 | + ->addColumn('related', function($query) use ($productId) { |
|
| 31 | 31 | return $query->RelatedProduct->title; |
| 32 | 32 | }) |
| 33 | - ->addColumn('product', function ($query) use ($productId) { |
|
| 33 | + ->addColumn('product', function($query) use ($productId) { |
|
| 34 | 34 | return $query->Product->title; |
| 35 | 35 | }) |
| 36 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 36 | + ->addColumn('action', function($query) use ($productId) { |
|
| 37 | 37 | $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')); |
| 38 | 38 | |
| 39 | 39 | return $deleteLink; |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function store(Request $request, $productId) |
| 57 | 57 | { |
| 58 | - $result = ProductRelatedProductService::create($request->all(), $productId); |
|
| 58 | + $result = ProductRelatedProductService::create($request->all(), $productId); |
|
| 59 | 59 | return redirect()->route('product.related-product.index', $productId); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function destroy($productId, $productRelatedProductId) |
| 63 | 63 | { |
| 64 | - $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 64 | + $result = ProductRelatedProductService::destroy($productRelatedProductId); |
|
| 65 | 65 | |
| 66 | 66 | if ($result) { |
| 67 | 67 | Notification::success('The related product is deleted.'); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ['product.*', |
| 34 | 34 | 'brand.title as brandtitle', |
| 35 | 35 | 'product_category.title as categorytitle'] |
| 36 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 36 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 37 | 37 | |
| 38 | 38 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 39 | 39 | |
@@ -42,23 +42,23 @@ discard block |
||
| 42 | 42 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 43 | 43 | |
| 44 | 44 | $datatables = \Datatables::of($product) |
| 45 | - ->filterColumn('reference_code', function ($query, $keyword) { |
|
| 45 | + ->filterColumn('reference_code', function($query, $keyword) { |
|
| 46 | 46 | $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 47 | 47 | }) |
| 48 | - ->filterColumn('active', function ($query, $keyword) { |
|
| 48 | + ->filterColumn('active', function($query, $keyword) { |
|
| 49 | 49 | $query->whereRaw("product.active like ?", ["%{$keyword}%"]); |
| 50 | 50 | ; |
| 51 | 51 | }) |
| 52 | 52 | |
| 53 | - ->addColumn('rank', function ($product) { |
|
| 53 | + ->addColumn('rank', function($product) { |
|
| 54 | 54 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">'; |
| 55 | 55 | |
| 56 | 56 | }) |
| 57 | 57 | |
| 58 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 58 | + ->filterColumn('title', function($query, $keyword) { |
|
| 59 | 59 | |
| 60 | 60 | $query->where( |
| 61 | - function ($query) use ($keyword) { |
|
| 61 | + function($query) use ($keyword) { |
|
| 62 | 62 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 63 | 63 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 64 | 64 | $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | ); |
| 68 | 68 | }) |
| 69 | 69 | |
| 70 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 70 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 71 | 71 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 72 | 72 | }) |
| 73 | 73 | |
| 74 | - ->addColumn('active', function ($product) { |
|
| 74 | + ->addColumn('active', function($product) { |
|
| 75 | 75 | if ($product->active) { |
| 76 | 76 | 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>'; |
| 77 | 77 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 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>'; |
| 80 | 80 | }) |
| 81 | 81 | |
| 82 | - ->addColumn('title', function ($product) { |
|
| 82 | + ->addColumn('title', function($product) { |
|
| 83 | 83 | if ($product->brand) { |
| 84 | 84 | return $product->brand->title.' | '.$product->title; |
| 85 | 85 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | }) |
| 89 | 89 | |
| 90 | 90 | |
| 91 | - ->addColumn('amount', function ($product) { |
|
| 91 | + ->addColumn('amount', function($product) { |
|
| 92 | 92 | if ($product->attributes->count()) { |
| 93 | 93 | return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>'; |
| 94 | 94 | } |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">'; |
| 97 | 97 | }) |
| 98 | 98 | |
| 99 | - ->addColumn('image', function ($product) { |
|
| 99 | + ->addColumn('image', function($product) { |
|
| 100 | 100 | if ($product->productImages->count()) { |
| 101 | 101 | return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'" />'; |
| 102 | 102 | } |
| 103 | 103 | }) |
| 104 | - ->addColumn('price', function ($product) { |
|
| 104 | + ->addColumn('price', function($product) { |
|
| 105 | 105 | |
| 106 | 106 | $result = ""; |
| 107 | 107 | if ($product->price) { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | 'amount' => $product->amount |
| 152 | 152 | ); |
| 153 | 153 | |
| 154 | - $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 154 | + $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | if ($product->discount_value) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | }) |
| 164 | 164 | |
| 165 | 165 | |
| 166 | - ->addColumn('categorytitle', function ($product) { |
|
| 166 | + ->addColumn('categorytitle', function($product) { |
|
| 167 | 167 | if ($product->subcategories()->count()) { |
| 168 | 168 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 169 | 169 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | return $product->categorytitle; |
| 173 | 173 | }) |
| 174 | 174 | |
| 175 | - ->addColumn('action', function ($product) { |
|
| 175 | + ->addColumn('action', function($product) { |
|
| 176 | 176 | $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title); |
| 177 | 177 | $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>'; |
| 178 | 178 | |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | ['product.*', |
| 196 | 196 | 'brand.title as brandtitle', |
| 197 | 197 | 'product_category.title as categorytitle'] |
| 198 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 198 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 199 | 199 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 200 | 200 | ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id') |
| 201 | 201 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 202 | 202 | |
| 203 | 203 | $datatables = \Datatables::of($product) |
| 204 | - ->addColumn('rank', function ($product) { |
|
| 204 | + ->addColumn('rank', function($product) { |
|
| 205 | 205 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">'; |
| 206 | 206 | }) |
| 207 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 207 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 208 | 208 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 209 | 209 | }) |
| 210 | - ->addColumn('title', function ($product) { |
|
| 210 | + ->addColumn('title', function($product) { |
|
| 211 | 211 | if ($product->brand) { |
| 212 | 212 | return $product->brand->title.' | '.$product->title; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | return $product->title; |
| 216 | 216 | }) |
| 217 | - ->addColumn('categorytitle', function ($product) { |
|
| 217 | + ->addColumn('categorytitle', function($product) { |
|
| 218 | 218 | if ($product->subcategories()->count()) { |
| 219 | 219 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 220 | 220 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | public function store(Request $request) |
| 245 | 245 | { |
| 246 | - $result = ProductService::create($request->all()); |
|
| 246 | + $result = ProductService::create($request->all()); |
|
| 247 | 247 | return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.'); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -288,10 +288,10 @@ discard block |
||
| 288 | 288 | public function postExport() |
| 289 | 289 | { |
| 290 | 290 | |
| 291 | - $result = ProductService::selectAllExport(); |
|
| 292 | - Excel::create('export', function ($excel) use ($result) { |
|
| 291 | + $result = ProductService::selectAllExport(); |
|
| 292 | + Excel::create('export', function($excel) use ($result) { |
|
| 293 | 293 | |
| 294 | - $excel->sheet('Products', function ($sheet) use ($result) { |
|
| 294 | + $excel->sheet('Products', function($sheet) use ($result) { |
|
| 295 | 295 | $newArray = array(); |
| 296 | 296 | foreach ($result as $row) { |
| 297 | 297 | $category = ""; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $i = 0; |
| 321 | 321 | foreach ($row->productImages as $image) { |
| 322 | 322 | $i++; |
| 323 | - $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 323 | + $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | public function update(Request $request, $productId) |
| 391 | 391 | { |
| 392 | 392 | $input = $request->all(); |
| 393 | - $result = ProductService::updateById($input, $productId); |
|
| 393 | + $result = ProductService::updateById($input, $productId); |
|
| 394 | 394 | |
| 395 | 395 | $redirect = redirect()->route('product.index'); |
| 396 | 396 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | public function destroy($id) |
| 422 | 422 | { |
| 423 | - $result = ProductService::destroy($id); |
|
| 423 | + $result = ProductService::destroy($id); |
|
| 424 | 424 | |
| 425 | 425 | if ($result) { |
| 426 | 426 | Notification::success('The product was deleted.'); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | if ($request->wantsJson()) { |
| 16 | 16 | $query = TaxRateService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 17 | - $datatables = Datatables::of($query)->addColumn('action', function ($query) { |
|
| 17 | + $datatables = Datatables::of($query)->addColumn('action', function($query) { |
|
| 18 | 18 | $deleteLink = Form::deleteajax(url()->route('tax-rate.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $query->title); |
| 19 | 19 | $links = '<a href="'.url()->route('tax-rate.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
| 20 | 20 | return $links; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function store(Request $request) |
| 35 | 35 | { |
| 36 | - $result = TaxRateService::create($request->all()); |
|
| 36 | + $result = TaxRateService::create($request->all()); |
|
| 37 | 37 | return TaxRateService::notificationRedirect('tax-rate.index', $result, 'The tax rate was inserted.'); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function update(Request $request, $taxRateId) |
| 46 | 46 | { |
| 47 | - $result = TaxRateService::updateById($request->all(), $taxRateId); |
|
| 47 | + $result = TaxRateService::updateById($request->all(), $taxRateId); |
|
| 48 | 48 | return TaxRateService::notificationRedirect('tax-rate.index', $result, 'The tax rate was updated.'); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function destroy($taxRateId) |
| 52 | 52 | { |
| 53 | - $result = TaxRateService::destroy($taxRateId); |
|
| 53 | + $result = TaxRateService::destroy($taxRateId); |
|
| 54 | 54 | if ($result) { |
| 55 | 55 | Notification::error('The tax rate was deleted.'); |
| 56 | 56 | return redirect()->route('tax-rate.index'); |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $datatables = Datatables::of($image) |
| 31 | 31 | |
| 32 | - ->addColumn('thumb', function ($image) { |
|
| 32 | + ->addColumn('thumb', function($image) { |
|
| 33 | 33 | return '<img src="/files/news/100x100/'.$image->news_id.'/'.$image->file.'" />'; |
| 34 | 34 | }) |
| 35 | - ->addColumn('action', function ($image) use ($newsId) { |
|
| 35 | + ->addColumn('action', function($image) use ($newsId) { |
|
| 36 | 36 | $deleteLink = Form::deleteajax(url()->route('news-images.destroy', array('newsId' => $newsId, 'id' => $image->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 37 | 37 | $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; |
| 38 | 38 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function store(Request $request, $newsId) |
| 55 | 55 | { |
| 56 | - $result = NewsService::createImage($request->all(), $newsId); |
|
| 56 | + $result = NewsService::createImage($request->all(), $newsId); |
|
| 57 | 57 | return NewsService::notificationRedirect(array('news-images.index', $newsId), $result, 'The news image was inserted.'); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function update(Request $request, $newsId, $newsImageId) |
| 67 | 67 | { |
| 68 | - $result = NewsService::updateImageById($request->all(), $newsId, $newsImageId); |
|
| 68 | + $result = NewsService::updateImageById($request->all(), $newsId, $newsImageId); |
|
| 69 | 69 | return NewsService::notificationRedirect(array('news-images.index', $newsId), $result, 'The news image was updated.'); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | public function destroy($newsId, $newsImageId) |
| 73 | 73 | { |
| 74 | - $result = NewsService::destroyImage($newsImageId); |
|
| 74 | + $result = NewsService::destroyImage($newsImageId); |
|
| 75 | 75 | |
| 76 | 76 | if ($result) { |
| 77 | 77 | Notification::success('The file was deleted.'); |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $datatables = Datatables::of($image) |
| 33 | 33 | |
| 34 | - ->addColumn('thumb', function ($image) { |
|
| 34 | + ->addColumn('thumb', function($image) { |
|
| 35 | 35 | return '<img src="/files/content/100x100/'.$image->content_id.'/'.$image->file.'" />'; |
| 36 | 36 | }) |
| 37 | - ->addColumn('action', function ($image) use ($contentId) { |
|
| 38 | - $deleteLink = Form::deleteajax('/admin/content/'.$contentId.'/images/'. $image->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 37 | + ->addColumn('action', function($image) use ($contentId) { |
|
| 38 | + $deleteLink = Form::deleteajax('/admin/content/'.$contentId.'/images/'.$image->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 39 | 39 | $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; |
| 40 | 40 | |
| 41 | 41 | return $links; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function store(Request $request, $contentId) |
| 57 | 57 | { |
| 58 | - $result = ContentService::createImage($request->all(), $contentId); |
|
| 58 | + $result = ContentService::createImage($request->all(), $contentId); |
|
| 59 | 59 | return ContentService::notificationRedirect(array('content.{contentId}.images.index', $contentId), $result, 'The content image was inserted.'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function update(Request $request, $contentId, $contentImageId) |
| 69 | 69 | { |
| 70 | - $result = ContentService::updateImageById($request->all(), $contentId, $contentImageId); |
|
| 70 | + $result = ContentService::updateImageById($request->all(), $contentId, $contentImageId); |
|
| 71 | 71 | return ContentService::notificationRedirect(array('content.{contentId}.images.index', $contentId), $result, 'The content image was updated.'); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function destroy($contentId, $contentImageId) |
| 75 | 75 | { |
| 76 | - $result = ContentService::destroyImage($contentImageId); |
|
| 76 | + $result = ContentService::destroyImage($contentImageId); |
|
| 77 | 77 | |
| 78 | 78 | if ($result) { |
| 79 | 79 | Notification::success('The file was deleted.'); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | use Hideyo\Ecommerce\Framework\Services\Order\OrderFacade as OrderService; |
| 15 | 15 | use Hideyo\Ecommerce\Framework\Services\Order\OrderStatusFacade as OrderStatusService; |
| 16 | 16 | use Hideyo\Ecommerce\Framework\Services\PaymentMethod\PaymentMethodFacade as PaymentMethodService; |
| 17 | -use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService;use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
| 17 | +use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService; use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
| 18 | 18 | |
| 19 | 19 | use Carbon\Carbon; |
| 20 | 20 | use Request; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | public function index() |
| 30 | 30 | { |
| 31 | - $shop = auth('hideyobackend')->user()->shop; |
|
| 31 | + $shop = auth('hideyobackend')->user()->shop; |
|
| 32 | 32 | $now = Carbon::now(); |
| 33 | 33 | |
| 34 | 34 | $revenueThisMonth = null; |
@@ -58,15 +58,15 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $datatables = \Datatables::of($order) |
| 60 | 60 | |
| 61 | - ->addColumn('generated_custom_order_id', function ($order) { |
|
| 61 | + ->addColumn('generated_custom_order_id', function($order) { |
|
| 62 | 62 | return $order->generated_custom_order_id; |
| 63 | 63 | }) |
| 64 | 64 | |
| 65 | - ->addColumn('created_at', function ($order) { |
|
| 65 | + ->addColumn('created_at', function($order) { |
|
| 66 | 66 | return date('d F H:i', strtotime($order->created_at)); |
| 67 | 67 | }) |
| 68 | 68 | |
| 69 | - ->addColumn('status', function ($order) { |
|
| 69 | + ->addColumn('status', function($order) { |
|
| 70 | 70 | if ($order->orderStatus) { |
| 71 | 71 | if ($order->orderStatus->color) { |
| 72 | 72 | 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>'; |
@@ -75,46 +75,46 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | }) |
| 77 | 77 | |
| 78 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 78 | + ->filterColumn('client', function($query, $keyword) { |
|
| 79 | 79 | |
| 80 | 80 | $query->where( |
| 81 | - function ($query) use ($keyword) { |
|
| 81 | + function($query) use ($keyword) { |
|
| 82 | 82 | $query->whereRaw("order_address.firstname like ?", ["%{$keyword}%"]); |
| 83 | 83 | $query->orWhereRaw("order_address.lastname like ?", ["%{$keyword}%"]); |
| 84 | 84 | ; |
| 85 | 85 | } |
| 86 | 86 | ); |
| 87 | 87 | }) |
| 88 | - ->addColumn('client', function ($order) { |
|
| 88 | + ->addColumn('client', function($order) { |
|
| 89 | 89 | if ($order->client) { |
| 90 | 90 | if ($order->orderBillAddress) { |
| 91 | - return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count() .')</a>'; |
|
| 91 | + return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count().')</a>'; |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | }) |
| 95 | - ->addColumn('products', function ($order) { |
|
| 95 | + ->addColumn('products', function($order) { |
|
| 96 | 96 | if ($order->products) { |
| 97 | 97 | return $order->products->count(); |
| 98 | 98 | } |
| 99 | 99 | }) |
| 100 | - ->addColumn('price_with_tax', function ($order) { |
|
| 100 | + ->addColumn('price_with_tax', function($order) { |
|
| 101 | 101 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
| 102 | 102 | return $money; |
| 103 | 103 | }) |
| 104 | 104 | |
| 105 | 105 | |
| 106 | - ->addColumn('paymentMethod', function ($order) { |
|
| 106 | + ->addColumn('paymentMethod', function($order) { |
|
| 107 | 107 | if ($order->orderPaymentMethod) { |
| 108 | 108 | return $order->orderPaymentMethod->title; |
| 109 | 109 | } |
| 110 | 110 | }) |
| 111 | - ->addColumn('sendingMethod', function ($order) { |
|
| 111 | + ->addColumn('sendingMethod', function($order) { |
|
| 112 | 112 | if ($order->orderSendingMethod) { |
| 113 | 113 | return $order->orderSendingMethod->title; |
| 114 | 114 | } |
| 115 | 115 | }) |
| 116 | - ->addColumn('action', function ($order) { |
|
| 117 | - $deleteLink = \Form::deleteajax('/admin/order/'. $order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 116 | + ->addColumn('action', function($order) { |
|
| 117 | + $deleteLink = \Form::deleteajax('/admin/order/'.$order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 118 | 118 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 119 | 119 | |
| 120 | 120 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if ($data and $data['order']) { |
| 149 | 149 | |
| 150 | - if($data['type'] == 'one-pdf') { |
|
| 150 | + if ($data['type'] == 'one-pdf') { |
|
| 151 | 151 | $pdfHtml = ""; |
| 152 | 152 | $countOrders = count($data['order']); |
| 153 | 153 | $i = 0; |
@@ -173,15 +173,15 @@ discard block |
||
| 173 | 173 | $pdf = PDF::loadHTML($pdfHtmlBody); |
| 174 | 174 | |
| 175 | 175 | return $pdf->download('order-'.$order->generated_custom_order_id.'.pdf'); |
| 176 | - } elseif($data['type'] == 'product-list') { |
|
| 176 | + } elseif ($data['type'] == 'product-list') { |
|
| 177 | 177 | $products = OrderService::productsByOrderIds($data['order']); |
| 178 | 178 | |
| 179 | - if($products) { |
|
| 179 | + if ($products) { |
|
| 180 | 180 | |
| 181 | 181 | |
| 182 | - Excel::create('products', function ($excel) use ($products) { |
|
| 182 | + Excel::create('products', function($excel) use ($products) { |
|
| 183 | 183 | |
| 184 | - $excel->sheet('Products', function ($sheet) use ($products) { |
|
| 184 | + $excel->sheet('Products', function($sheet) use ($products) { |
|
| 185 | 185 | $newArray = array(); |
| 186 | 186 | foreach ($products as $key => $row) { |
| 187 | 187 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | if ($orders) { |
| 214 | 214 | Request::session()->put('print_orders', $orders->toArray()); |
| 215 | - return response()->json(array('orders' => $orders->toArray() )); |
|
| 215 | + return response()->json(array('orders' => $orders->toArray())); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | Request::session()->destroy('print_orders'); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | public function downloadLabel($orderId) |
| 256 | 256 | { |
| 257 | 257 | $order = OrderService::find($orderId); |
| 258 | - if($order->orderLabel()->count()) { |
|
| 258 | + if ($order->orderLabel()->count()) { |
|
| 259 | 259 | header("Content-type: application/octet-stream"); |
| 260 | 260 | header("Content-disposition: attachment;filename=label.pdf"); |
| 261 | 261 | echo $order->orderLabel->data; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | ); |
| 289 | 289 | foreach ($replace as $key => $val) { |
| 290 | - $content = str_replace("[" . $key . "]", $val, $content); |
|
| 290 | + $content = str_replace("[".$key."]", $val, $content); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $content; |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | public function update($orderId) |
| 302 | 302 | { |
| 303 | - $result = OrderService::updateById(Request::all(), $orderId); |
|
| 303 | + $result = OrderService::updateById(Request::all(), $orderId); |
|
| 304 | 304 | |
| 305 | 305 | if ($result->errors()->all()) { |
| 306 | 306 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -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.'); |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | |
| 22 | 22 | $query = $this->error->getModel(); |
| 23 | 23 | |
| 24 | - $datatables = \Datatables::of($query)->addColumn('action', function ($query) { |
|
| 25 | - $deleteLink = \Form::deleteajax('/admin/general-setting/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 24 | + $datatables = \Datatables::of($query)->addColumn('action', function($query) { |
|
| 25 | + $deleteLink = \Form::deleteajax('/admin/general-setting/'.$query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 26 | 26 | $links = '<a href="/admin/general-setting/'.$query->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 27 | 27 | |
| 28 | 28 | return $links; |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $datatables = Datatables::of($productCategory) |
| 29 | 29 | |
| 30 | - ->addColumn('image', function ($productCategory) { |
|
| 30 | + ->addColumn('image', function($productCategory) { |
|
| 31 | 31 | if ($productCategory->productCategoryImages->count()) { |
| 32 | 32 | return '<img src="/files/product_category/100x100/'.$productCategory->id.'/'.$productCategory->productCategoryImages->first()->file.'" />'; |
| 33 | 33 | } |
| 34 | 34 | }) |
| 35 | 35 | |
| 36 | - ->addColumn('title', function ($productCategory) { |
|
| 36 | + ->addColumn('title', function($productCategory) { |
|
| 37 | 37 | |
| 38 | 38 | $categoryTitle = $productCategory->title; |
| 39 | 39 | if ($productCategory->refProductCategory) { |
@@ -47,17 +47,17 @@ discard block |
||
| 47 | 47 | return $categoryTitle; |
| 48 | 48 | }) |
| 49 | 49 | |
| 50 | - ->addColumn('products', function ($productCategory) { |
|
| 50 | + ->addColumn('products', function($productCategory) { |
|
| 51 | 51 | return $productCategory->products->count(); |
| 52 | 52 | }) |
| 53 | - ->addColumn('parent', function ($productCategory) { |
|
| 53 | + ->addColumn('parent', function($productCategory) { |
|
| 54 | 54 | |
| 55 | 55 | if ($productCategory->parent()->count()) { |
| 56 | 56 | return $productCategory->parent()->first()->title; |
| 57 | 57 | } |
| 58 | 58 | }) |
| 59 | 59 | |
| 60 | - ->addColumn('active', function ($product) { |
|
| 60 | + ->addColumn('active', function($product) { |
|
| 61 | 61 | if ($product->active) { |
| 62 | 62 | return '<a href="#" class="change-active" data-url="/admin/product-category/change-active/'.$product->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 63 | 63 | } |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | }) |
| 67 | 67 | |
| 68 | 68 | |
| 69 | - ->addColumn('seo', function ($productCategory) { |
|
| 69 | + ->addColumn('seo', function($productCategory) { |
|
| 70 | 70 | if ($productCategory->meta_title && $productCategory->meta_description) { |
| 71 | 71 | return '<i class="fa fa-check"></i>'; |
| 72 | 72 | } |
| 73 | 73 | }) |
| 74 | - ->addColumn('action', function ($productCategory) { |
|
| 74 | + ->addColumn('action', function($productCategory) { |
|
| 75 | 75 | $deleteLink = Form::deleteajax(url()->route('product-category.destroy', $productCategory->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $productCategory->title); |
| 76 | 76 | $links = '<a href="'.url()->route('product-category.edit', $productCategory->id).'" class="btn btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 77 | 77 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function store(Request $request) |
| 134 | 134 | { |
| 135 | - $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 135 | + $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 136 | 136 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was inserted.'); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | public function update(Request $request, $productCategoryId) |
| 156 | 156 | { |
| 157 | - $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 157 | + $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 158 | 158 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was updated.'); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | public function destroy($productCategoryId) |
| 162 | 162 | { |
| 163 | - $result = ProductCategoryService::destroy($productCategoryId); |
|
| 163 | + $result = ProductCategoryService::destroy($productCategoryId); |
|
| 164 | 164 | |
| 165 | 165 | if ($result) { |
| 166 | 166 | Notification::success('Category was deleted.'); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } elseif ($parent->children()->count()) { |
| 231 | 231 | $node->makeLastChildOf($parent); |
| 232 | 232 | foreach ($parent->children()->get() as $key => $row) { |
| 233 | - $positionKey = $position - 1; |
|
| 233 | + $positionKey = $position - 1; |
|
| 234 | 234 | if ($key == $positionKey) { |
| 235 | 235 | $node->moveToRightOf($row); |
| 236 | 236 | } |