Passed
Push — master ( cd4b7b...19cfe1 )
by Matthijs
05:23
created
app/Http/Controllers/Backend/BrandController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         if ($request->wantsJson()) {
23 23
             $brand = BrandService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id);
24 24
             
25
-            $datatables = DataTables::of($brand)->addColumn('action', function ($query) {
25
+            $datatables = DataTables::of($brand)->addColumn('action', function($query) {
26 26
                 $deleteLink = Form::deleteajax(url()->route('brand.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $query->title);
27 27
                 $links = '<a href="'.url()->route('brand.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
28 28
             
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function store(Request $request)
44 44
     {
45
-        $result  = BrandService::create($request->all());
45
+        $result = BrandService::create($request->all());
46 46
         return BrandService::notificationRedirect('brand.index', $result, 'The brand was inserted.');
47 47
     }
48 48
 
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function update(Request $request, $brandId)
55 55
     {
56
-        $result  = BrandService::updateById($request->all(), $brandId);
56
+        $result = BrandService::updateById($request->all(), $brandId);
57 57
         return BrandService::notificationRedirect('brand.index', $result, 'The brand was updated.');
58 58
     }
59 59
 
60 60
     public function destroy($brandId)
61 61
     {
62
-        $result  = BrandService::destroy($brandId);
62
+        $result = BrandService::destroy($brandId);
63 63
         if ($result) {
64 64
             Notification::error('The brand was deleted.');
65 65
             return redirect()->route('brand.index');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductRelatedProductController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
             $query = ProductRelatedProductService::getModel()->where('product_id', '=', $productId);
26 26
             
27 27
             $datatables = \DataTables::of($query)
28
-                ->addColumn('related', function ($query) use ($productId) {
28
+                ->addColumn('related', function($query) use ($productId) {
29 29
                     return $query->RelatedProduct->title;
30 30
                 })
31
-                ->addColumn('product', function ($query) use ($productId) {
31
+                ->addColumn('product', function($query) use ($productId) {
32 32
                     return $query->Product->title;
33 33
                 })
34
-                ->addColumn('action', function ($query) use ($productId) {
34
+                ->addColumn('action', function($query) use ($productId) {
35 35
                     $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'));
36 36
                     
37 37
                     return $deleteLink;
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
     
53 53
     public function store(Request $request, $productId)
54 54
     {
55
-        $result  = ProductRelatedProductService::create($request->all(), $productId);
55
+        $result = ProductRelatedProductService::create($request->all(), $productId);
56 56
         return redirect()->route('product.related-product.index', $productId);
57 57
     }
58 58
 
59 59
     public function destroy($productId, $productRelatedProductId)
60 60
     {
61
-        $result  = ProductRelatedProductService::destroy($productRelatedProductId);
61
+        $result = ProductRelatedProductService::destroy($productRelatedProductId);
62 62
 
63 63
         if ($result) {
64 64
             Notification::success('The related product is deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/FaqItemController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
             ->where('faq_item.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id);
35 35
 
36 36
             $datatables = DataTables::of($query)
37
-            ->addColumn('faqitemgroup', function ($query) {
37
+            ->addColumn('faqitemgroup', function($query) {
38 38
                 return $query->grouptitle;
39 39
             })
40
-            ->addColumn('action', function ($query) {
40
+            ->addColumn('action', function($query) {
41 41
                 $deleteLink = Form::deleteajax(url()->route('faq.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
42 42
                 $links = '<a href="'.url()->route('faq.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
43 43
             
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     public function store(Request $request)
60 60
     {
61
-        $result  = FaqService::create($request->all());
61
+        $result = FaqService::create($request->all());
62 62
         return FaqService::notificationRedirect('faq.index', $result, 'FaqItem was inserted.');
63 63
     }
64 64
 
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 
71 71
     public function update(Request $request, $faqId)
72 72
     {
73
-        $result  = FaqService::updateById($request->all(), $faqId);
73
+        $result = FaqService::updateById($request->all(), $faqId);
74 74
         return FaqService::notificationRedirect('faq.index', $result, 'FaqItem was updated.');
75 75
     }
76 76
 
77 77
     public function destroy($faqItemId)
78 78
     {
79
-        $result  = FaqService::destroy($faqItemId);
79
+        $result = FaqService::destroy($faqItemId);
80 80
 
81 81
         if ($result) {
82 82
             Notification::success('The faq was deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/OrderController.php 1 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/PaymentMethodController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
             
28 28
             $datatables = DataTables::of($query)
29 29
 
30
-            ->addColumn('orderconfirmed', function ($query) {
30
+            ->addColumn('orderconfirmed', function($query) {
31 31
                 if ($query->orderConfirmedOrderStatus) {
32 32
                     return $query->orderConfirmedOrderStatus->title;
33 33
                 }
34 34
             })
35
-            ->addColumn('paymentcompleted', function ($query) {
35
+            ->addColumn('paymentcompleted', function($query) {
36 36
                 if ($query->orderPaymentCompletedOrderStatus) {
37 37
                     return $query->orderPaymentCompletedOrderStatus->title;
38 38
                 }
39 39
             })
40
-            ->addColumn('paymentfailed', function ($query) {
40
+            ->addColumn('paymentfailed', function($query) {
41 41
                 if ($query->orderPaymentFailedOrderStatus) {
42 42
                     return $query->orderPaymentFailedOrderStatus->title;
43 43
                 }
44 44
             })
45
-            ->addColumn('action', function ($query) {
45
+            ->addColumn('action', function($query) {
46 46
                 $deleteLink = Form::deleteajax(url()->route('payment-method.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'));
47 47
                 $links = '<a href="'.url()->route('payment-method.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a>  '.$deleteLink;
48 48
                 return $links;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     public function store(Request $request)
69 69
     {
70
-        $result  = PaymentMethodService::create($request->all());
70
+        $result = PaymentMethodService::create($request->all());
71 71
         return PaymentMethodService::notificationRedirect('payment-method.index', $result, 'The payment method was inserted.');
72 72
     }
73 73
 
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function update(Request $request, $paymentMethodId)
86 86
     {
87
-        $result  = PaymentMethodService::updateById($request->all(), $paymentMethodId);
87
+        $result = PaymentMethodService::updateById($request->all(), $paymentMethodId);
88 88
         return PaymentMethodService::notificationRedirect('payment-method.index', $result, 'The payment method was updated.');
89 89
     }
90 90
 
91 91
     public function destroy($paymentMethodId)
92 92
     {
93
-        $result  = PaymentMethodService::destroy($paymentMethodId);
93
+        $result = PaymentMethodService::destroy($paymentMethodId);
94 94
 
95 95
         if ($result) {
96 96
             Notification::success('The payment method was deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Frontend/CheckoutController.php 1 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/BasicController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
             Notification::error($validator->errors()->all());  
36 36
         }
37 37
 
38
-        Mail::send('frontend.email.contact', ['data' => $input], function ($m) use ($input) {
38
+        Mail::send('frontend.email.contact', ['data' => $input], function($m) use ($input) {
39 39
             $m->from('[email protected]', 'Dutchbridge');
40 40
             $m->replyTo($input['email'], $input['name']);
41 41
             $m->to('[email protected]')->subject(': thnx for your contact!');
Please login to merge, or discard this patch.
app/Http/Controllers/Frontend/NewsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function getItem(Request $request, $newsGroupSlug, $slug)
11 11
     {
12 12
         $news = NewsService::selectOneBySlug(config()->get('app.shop_id'), $slug);
13
-        $newsGroups =  NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));     
13
+        $newsGroups = NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));     
14 14
 
15 15
         if ($news) {
16 16
             if ($news->slug != $slug or $news->newsGroup->slug != $newsGroupSlug) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $page = $request->get('page', 1);
29 29
         $news = NewsService::selectByGroupAndByShopIdAndPaginate(config()->get('app.shop_id'), $newsGroupSlug, 25);
30 30
         $newsGroup = NewsService::selectOneGroupByShopIdAndSlug(config()->get('app.shop_id'), $newsGroupSlug);
31
-        $newsGroups =  NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));
31
+        $newsGroups = NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));
32 32
         
33 33
         if ($newsGroup) {
34 34
             return view('frontend.news.group')->with(array('selectedPage' => $page, 'news' => $news, 'newsGroups' => $newsGroups, 'newsGroup' => $newsGroup));
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $page = $request->get('page', 1);
43 43
         $news = NewsService::selectAllByShopIdAndPaginate(config()->get('app.shop_id'), 25);
44
-        $newsGroups =  NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));
44
+        $newsGroups = NewsService::selectAllActiveGroupsByShopId(config()->get('app.shop_id'));
45 45
         if ($news) {
46 46
             return view('frontend.news.index')->with(array('selectedPage' => $page, 'news' => $news, 'newsGroups' => $newsGroups));
47 47
         }
Please login to merge, or discard this patch.