Passed
Push — master ( cd4b7b...19cfe1 )
by Matthijs
05:23
created
app/Http/Controllers/Frontend/CheckoutController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                     'paymentMethodsList' => $paymentMethodsList));
63 63
             }
64 64
               
65
-             return view('frontend.checkout.login')->with(array(  'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList));
65
+                return view('frontend.checkout.login')->with(array(  'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList));
66 66
         }
67 67
 
68 68
         $user = auth('web')->user();
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 
25 25
             $paymentMethodsList = Cart::getConditionsByType('sending_method')->first()->getAttributes()['data']['related_payment_methods_list'];
26 26
          
27
-            if(!Cart::getConditionsByType('sending_method')->count()) {
27
+            if (!Cart::getConditionsByType('sending_method')->count()) {
28 28
                 Notification::error('Selecteer een verzendwijze');
29 29
                 return redirect()->to('cart');
30 30
             }
31 31
 
32
-            if(!Cart::getConditionsByType('payment_method')->count()) {
32
+            if (!Cart::getConditionsByType('payment_method')->count()) {
33 33
                 Notification::error('Selecteer een betaalwijze');
34 34
                 return redirect()->to('cart');
35 35
             }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     'paymentMethodsList' => $paymentMethodsList));
53 53
             }
54 54
               
55
-             return view('frontend.checkout.login')->with(array(  'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList));
55
+             return view('frontend.checkout.login')->with(array('sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList));
56 56
         }
57 57
 
58 58
         $user = auth('web')->user();
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         // create the validation rules ------------------------
75 75
         $rules = array(
76
-            'email'         => 'required|email',     // required and must be unique in the ducks table
76
+            'email'         => 'required|email', // required and must be unique in the ducks table
77 77
             'password'      => 'required'
78 78
         );
79 79
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $userdata = $request->all();
117 117
 
118 118
         $rules = array(
119
-            'email'         => 'required|email',     // required and must be unique in the ducks table
119
+            'email'         => 'required|email', // required and must be unique in the ducks table
120 120
             'password'      => 'required',
121 121
             'firstname'     => 'required',
122 122
             'lastname'      => 'required',
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 $data = $register;
164 164
                 $data['shop'] = app('shop');
165 165
         
166
-                Mail::send('frontend.email.register-mail', array('password' => $userdata['password'], 'user' => $data->toArray(), 'billAddress' => $data->clientBillAddress->toArray()), function ($message) use ($data) {
166
+                Mail::send('frontend.email.register-mail', array('password' => $userdata['password'], 'user' => $data->toArray(), 'billAddress' => $data->clientBillAddress->toArray()), function($message) use ($data) {
167 167
             
168 168
                     $message->to($data['email'])->from($data['shop']->email, $data['shop']->title)->subject('Je bent geregistreerd.');
169 169
                 });
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
             $data['user_id'] = $noAccountUser['client_id'];
230 230
         }     
231 231
 
232
-        if(Cart::getConditionsByType('sending_method')->count()) {
232
+        if (Cart::getConditionsByType('sending_method')->count()) {
233 233
             $data['sending_method'] = Cart::getConditionsByType('sending_method');
234 234
         }
235 235
 
236
-        if(Cart::getConditionsByType('sending_method_country_price')->count()) {
236
+        if (Cart::getConditionsByType('sending_method_country_price')->count()) {
237 237
             $data['sending_method_country_price'] = Cart::getConditionsByType('sending_method_country_price');
238 238
         }
239 239
 
240
-        if(Cart::getConditionsByType('payment_method')->count()) {
240
+        if (Cart::getConditionsByType('payment_method')->count()) {
241 241
             $data['payment_method'] = Cart::getConditionsByType('payment_method');
242 242
         }
243 243
 
Please login to merge, or discard this patch.
app/Http/Controllers/Frontend/AccountController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@
 block discarded – undo
209 209
 
210 210
         Notification::error('wachtwoord vergeten is mislukt');
211 211
         return redirect()->to('account/forgot-password')
212
-          ->withErrors(true, 'forgot')->withInput();
212
+            ->withErrors(true, 'forgot')->withInput();
213 213
     }
214 214
 
215 215
     public function postResetPassword(Request $request, $confirmationCode, $email)
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         );
60 60
 
61 61
         foreach ($replace as $key => $val) {
62
-            $content = str_replace("[" . $key . "]", $val, $content);
62
+            $content = str_replace("[".$key."]", $val, $content);
63 63
         }
64 64
 
65 65
         return $content;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                     'confirmation_code' => $requestChange->confirmation_code
164 164
                 );
165 165
 
166
-                Mail::send('frontend.email.reset-account-settings-mail', $data, function ($message) use ($data) {
166
+                Mail::send('frontend.email.reset-account-settings-mail', $data, function($message) use ($data) {
167 167
                 
168 168
                     $message->to($data['email'])->from('[email protected]', 'Hideyo')->subject('confirm changing account details');
169 169
                 });
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                 'code' => $forgotPassword->confirmation_code
288 288
             );
289 289
 
290
-            Mail::send('frontend.email.reset-password-mail', $data, function ($message) use ($data) {
290
+            Mail::send('frontend.email.reset-password-mail', $data, function($message) use ($data) {
291 291
             
292 292
                 $message->to($data['email'])->from('[email protected]', 'Phil & Phae')->subject('Wachtwoord vergeten');
293 293
             });
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
         $validateRegister = ClientService::validateRegister($userdata);
370 370
 
371
-        if($validateRegister->fails()) {
371
+        if ($validateRegister->fails()) {
372 372
 
373 373
             foreach ($validator->errors()->all() as $error) {
374 374
                 Notification::error($error);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $register = ClientService::register($userdata, config()->get('app.shop_id'));
381 381
 
382 382
         if ($register) {
383
-            Mail::send('frontend.email.register-mail', array('user' => $register->toArray(), 'password' => $request->get('password'), 'billAddress' => $register->clientBillAddress->toArray()), function ($message) use ($data) {
383
+            Mail::send('frontend.email.register-mail', array('user' => $register->toArray(), 'password' => $request->get('password'), 'billAddress' => $register->clientBillAddress->toArray()), function($message) use ($data) {
384 384
                 $message->to($data['email'])->from('[email protected]', 'Hideyo')->subject(trans('register-completed-subject'));
385 385
             });
386 386
             Notification::success(trans('you-are-registered-consumer'));
Please login to merge, or discard this patch.
app/Http/Controllers/Frontend/ProductController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $template = 'frontend.product.combinations';
44 44
 
45 45
                 $leadingAttributeId = key(reset($newPullDowns));
46
-                if($productAttributeId) { 
46
+                if ($productAttributeId) { 
47 47
                     $leadingAttributeId = $productAttributeId;
48 48
                 } else {
49 49
                     $productAttributeId = $pullDowns['productAttribute']->first()->id;
Please login to merge, or discard this patch.
app/Http/Controllers/Frontend/CartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
   
27 27
         if (app('cart')->getContent()->count()) {
28 28
             
29
-            if($sendingMethodsList->count() AND !app('cart')->getConditionsByType('sending_method')->count()) {
29
+            if ($sendingMethodsList->count() AND !app('cart')->getConditionsByType('sending_method')->count()) {
30 30
                 self::updateSendingMethod($sendingMethodsList->first()->id);
31 31
             }      
32 32
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             $request->get('amount')
74 74
         );
75 75
 
76
-        if($result){
76
+        if ($result) {
77 77
 
78 78
             return response()->json(array(
79 79
                 'result' => true, 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $product = app('cart')->get($productId);
107 107
             $amountNa = false;
108 108
 
109
-            if($product->quantity < $amount) {
109
+            if ($product->quantity < $amount) {
110 110
                 $amountNa = view('frontend.cart.amount-na')->with(array('product' => $product))->render();
111 111
             }
112 112
             
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ClientOrderController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
             ->addColumn('status', function ($order) {
48 48
                 if ($order->orderStatus) {
49
-                     return $order->orderStatus->title;
49
+                        return $order->orderStatus->title;
50 50
                 }
51 51
             })
52 52
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
             
45 45
             $datatables = DataTables::of($order)
46 46
 
47
-            ->addColumn('status', function ($order) {
47
+            ->addColumn('status', function($order) {
48 48
                 if ($order->orderStatus) {
49 49
                      return $order->orderStatus->title;
50 50
                 }
51 51
             })
52 52
 
53
-            ->addColumn('created_at', function ($order) {
53
+            ->addColumn('created_at', function($order) {
54 54
                 return date('d F H:i', strtotime($order->created_at));
55 55
             })
56
-            ->addColumn('status', function ($order) {
56
+            ->addColumn('status', function($order) {
57 57
                 if ($order->orderStatus) {
58 58
                     if ($order->orderStatus->color) {
59 59
                         return '<a href="/admin/order/'.$order->id.'" style="text-decoration:none;"><span style="background-color:'.$order->orderStatus->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$order->orderStatus->title.'</span></a>';
@@ -61,33 +61,33 @@  discard block
 block discarded – undo
61 61
                     return $order->orderStatus->title;
62 62
                 }
63 63
             })
64
-            ->addColumn('client', function ($order) {
64
+            ->addColumn('client', function($order) {
65 65
                 if ($order->client) {
66 66
                     if ($order->orderBillAddress) {
67 67
                         return $order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname;
68 68
                     }
69 69
                 }
70 70
             })
71
-            ->addColumn('products', function ($order) {
71
+            ->addColumn('products', function($order) {
72 72
                 if ($order->products) {
73 73
                     return $order->products->count();
74 74
                 }
75 75
             })
76
-            ->addColumn('price_with_tax', function ($order) {
76
+            ->addColumn('price_with_tax', function($order) {
77 77
                 $money = '&euro; '.$order->getPriceWithTaxNumberFormat();
78 78
                 return $money;
79 79
             })
80
-            ->addColumn('paymentMethod', function ($order) {
80
+            ->addColumn('paymentMethod', function($order) {
81 81
                 if ($order->orderPaymentMethod) {
82 82
                     return $order->orderPaymentMethod->title;
83 83
                 }
84 84
             })
85
-            ->addColumn('sendingMethod', function ($order) {
85
+            ->addColumn('sendingMethod', function($order) {
86 86
                 if ($order->orderSendingMethod) {
87 87
                     return $order->orderSendingMethod->title;
88 88
                 }
89 89
             })
90
-            ->addColumn('action', function ($order) {
90
+            ->addColumn('action', function($order) {
91 91
                 $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a>  ';
92 92
                 $links = '<a href="/admin/order/'.$order->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a>  '.$download;
93 93
             
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductExtraFieldValueController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
47 47
     public function store($productId, Request $request)
48 48
     {
49 49
         $result  = ProductExtraFieldValueService::create($request->all(), $productId);
50
-         return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.');
50
+            return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.');
51 51
     }
52 52
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
     public function store($productId, Request $request)
48 48
     {
49
-        $result  = ProductExtraFieldValueService::create($request->all(), $productId);
49
+        $result = ProductExtraFieldValueService::create($request->all(), $productId);
50 50
          return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.');
51 51
     }
52 52
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/OrderController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -259,9 +259,9 @@
 block discarded – undo
259 259
     {
260 260
         $order = OrderService::find($orderId);
261 261
         if($order->orderLabel()->count()) {
262
-          header("Content-type: application/octet-stream");
263
-          header("Content-disposition: attachment;filename=label.pdf");
264
-          echo $order->orderLabel->data;
262
+            header("Content-type: application/octet-stream");
263
+            header("Content-disposition: attachment;filename=label.pdf");
264
+            echo $order->orderLabel->data;
265 265
         }
266 266
     }
267 267
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 = '&euro; '.$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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
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
                 );
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
147 147
                         'amount' => $product->amount
148 148
                         );
149 149
 
150
-                    $result =  '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
150
+                    $result = '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
151 151
 
152 152
 
153 153
                     if ($product->discount_value) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductImageController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 {
19 19
     public function index(Request $request, $productId)
20 20
     {
21
-           $product = ProductService::find($productId);
21
+            $product = ProductService::find($productId);
22 22
         if ($request->wantsJson()) {
23 23
 
24 24
             $query = ProductService::getImageModel()->where('product_id', '=', $productId);
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
                 foreach ($newProductAttributes as $key => $productAttribute) {
97 97
                     $newArray = array();
98 98
                     foreach ($productAttribute as $keyNew => $valueNew) {
99
-                         $newArray[] = $keyNew.': '.$valueNew['value'];
100
-                         $attributesList[$valueNew['id']] = $valueNew['value'];
99
+                            $newArray[] = $keyNew.': '.$valueNew['value'];
100
+                            $attributesList[$valueNew['id']] = $valueNew['value'];
101 101
                     }
102 102
                     $productAttributesList[$key] = implode(', ', $newArray);
103 103
                 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.');
Please login to merge, or discard this patch.