Passed
Push — master ( 65a680...2232db )
by Matthijs
17:59 queued 12:07
created
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   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function index()
33 33
     {
34
-        $shop  = auth('hideyobackend')->user()->shop;
34
+        $shop = auth('hideyobackend')->user()->shop;
35 35
         $now = Carbon::now();
36 36
 
37 37
         $revenueThisMonth = null;
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
             
62 62
             $datatables = \Datatables::of($order)
63 63
 
64
-            ->addColumn('generated_custom_order_id', function ($order) {
64
+            ->addColumn('generated_custom_order_id', function($order) {
65 65
                 return $order->generated_custom_order_id;
66 66
             })
67 67
 
68
-            ->addColumn('created_at', function ($order) {
68
+            ->addColumn('created_at', function($order) {
69 69
                 return date('d F H:i', strtotime($order->created_at));
70 70
             })
71 71
 
72
-            ->addColumn('status', function ($order) {
72
+            ->addColumn('status', function($order) {
73 73
                 if ($order->orderStatus) {
74 74
                     if ($order->orderStatus->color) {
75 75
                         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>';
@@ -78,46 +78,46 @@  discard block
 block discarded – undo
78 78
                 }
79 79
             })
80 80
 
81
-            ->filterColumn('client', function ($query, $keyword) {
81
+            ->filterColumn('client', function($query, $keyword) {
82 82
 
83 83
                 $query->where(
84
-                    function ($query) use ($keyword) {
84
+                    function($query) use ($keyword) {
85 85
                         $query->whereRaw("order_address.firstname like ?", ["%{$keyword}%"]);
86 86
                         $query->orWhereRaw("order_address.lastname like ?", ["%{$keyword}%"]);
87 87
                         ;
88 88
                     }
89 89
                 );
90 90
             })
91
-            ->addColumn('client', function ($order) {
91
+            ->addColumn('client', function($order) {
92 92
                 if ($order->client) {
93 93
                     if ($order->orderBillAddress) {
94
-                        return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count() .')</a>';
94
+                        return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count().')</a>';
95 95
                     }
96 96
                 }
97 97
             })
98
-            ->addColumn('products', function ($order) {
98
+            ->addColumn('products', function($order) {
99 99
                 if ($order->products) {
100 100
                     return $order->products->count();
101 101
                 }
102 102
             })
103
-            ->addColumn('price_with_tax', function ($order) {
103
+            ->addColumn('price_with_tax', function($order) {
104 104
                 $money = '&euro; '.$order->getPriceWithTaxNumberFormat();
105 105
                 return $money;
106 106
             })
107 107
 
108 108
 
109
-            ->addColumn('paymentMethod', function ($order) {
109
+            ->addColumn('paymentMethod', function($order) {
110 110
                 if ($order->orderPaymentMethod) {
111 111
                     return $order->orderPaymentMethod->title;
112 112
                 }
113 113
             })
114
-            ->addColumn('sendingMethod', function ($order) {
114
+            ->addColumn('sendingMethod', function($order) {
115 115
                 if ($order->orderSendingMethod) {
116 116
                     return $order->orderSendingMethod->title;
117 117
                 }
118 118
             })
119
-            ->addColumn('action', function ($order) {
120
-                $deleteLink = \Form::deleteajax('/admin/order/'. $order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
119
+            ->addColumn('action', function($order) {
120
+                $deleteLink = \Form::deleteajax('/admin/order/'.$order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
121 121
                 $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a>  ';
122 122
             
123 123
        
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         if ($data and $data['order']) {
152 152
 
153
-            if($data['type'] == 'one-pdf') {
153
+            if ($data['type'] == 'one-pdf') {
154 154
                 $pdfHtml = "";
155 155
                 $countOrders = count($data['order']);
156 156
                 $i = 0;
@@ -176,15 +176,15 @@  discard block
 block discarded – undo
176 176
                 $pdf = PDF::loadHTML($pdfHtmlBody);
177 177
 
178 178
                 return $pdf->download('order-'.$order->generated_custom_order_id.'.pdf');
179
-            } elseif($data['type'] == 'product-list') {
179
+            } elseif ($data['type'] == 'product-list') {
180 180
                 $products = OrderService::productsByOrderIds($data['order']);
181 181
 
182
-                if($products) {
182
+                if ($products) {
183 183
 
184 184
 
185
-                    Excel::create('products', function ($excel) use ($products) {
185
+                    Excel::create('products', function($excel) use ($products) {
186 186
 
187
-                        $excel->sheet('Products', function ($sheet) use ($products) {
187
+                        $excel->sheet('Products', function($sheet) use ($products) {
188 188
                             $newArray = array();
189 189
                             foreach ($products as $key => $row) {
190 190
                 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         if ($orders) {
217 217
             Request::session()->put('print_orders', $orders->toArray());
218
-            return response()->json(array('orders' => $orders->toArray() ));
218
+            return response()->json(array('orders' => $orders->toArray()));
219 219
         }
220 220
 
221 221
         Request::session()->destroy('print_orders');
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     public function downloadLabel($orderId)
259 259
     {
260 260
         $order = OrderService::find($orderId);
261
-        if($order->orderLabel()->count()) {
261
+        if ($order->orderLabel()->count()) {
262 262
           header("Content-type: application/octet-stream");
263 263
           header("Content-disposition: attachment;filename=label.pdf");
264 264
           echo $order->orderLabel->data;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
         );
292 292
         foreach ($replace as $key => $val) {
293
-            $content = str_replace("[" . $key . "]", $val, $content);
293
+            $content = str_replace("[".$key."]", $val, $content);
294 294
         }
295 295
 
296 296
         return $content;
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     public function update($orderId)
305 305
     {
306
-        $result  = OrderService::updateById(Request::all(), $orderId);
306
+        $result = OrderService::updateById(Request::all(), $orderId);
307 307
 
308 308
         if ($result->errors()->all()) {
309 309
             return redirect()->back()->withInput()->withErrors($result->errors()->all());
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductCombinationController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $product = ProductService::find($productId);
35 35
 
36
-        if($product) {
36
+        if ($product) {
37 37
             if ($this->request->wantsJson()) {
38 38
 
39 39
                 $query = ProductCombinationService::getModel()->select(
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
                     'default_on']
42 42
                 )->where('product_id', '=', $productId);
43 43
 
44
-                $datatables = \Datatables::of($query)->addColumn('action', function ($query) use ($productId) {
44
+                $datatables = \Datatables::of($query)->addColumn('action', function($query) use ($productId) {
45 45
                     $deleteLink = \Form::deleteajax(url()->route('product-combination.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
46 46
                     $links = '<a href="'.url()->route('product-combination.edit', array('productId' => $productId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
47 47
                 
48 48
                     return $links;
49 49
                 })
50 50
 
51
-                ->addColumn('amount', function ($query) {
51
+                ->addColumn('amount', function($query) {
52 52
                     return '<input type="text" class="change-amount-product-attribute" value="'.$query->amount.'" data-url="/admin/product/'.$query->product_id.'/product-combination/change-amount-attribute/'.$query->id.'">';
53 53
                 })
54 54
 
55
-                ->addColumn('price', function ($query) {
55
+                ->addColumn('price', function($query) {
56 56
                     $result = 0;
57 57
                     if ($query->price) {
58 58
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                             'amount' => $query->amount
102 102
                             );
103 103
 
104
-                        $result =  '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
104
+                        $result = '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
105 105
 
106 106
 
107 107
                         if ($query->discount_value) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     return $result;
113 113
                 })
114 114
 
115
-                ->addColumn('combinations', function ($query) use ($productId) {
115
+                ->addColumn('combinations', function($query) use ($productId) {
116 116
                     $items = array();
117 117
                     foreach ($query->combinations as $row) {
118 118
                         $items[] = $row->attribute->attributeGroup->title.': '.$row->attribute->value;
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 
158 158
     public function store($productId)
159 159
     {
160
-        $result  = ProductCombinationService::create($this->request->all(), $productId);
161
-        if($result) {
160
+        $result = ProductCombinationService::create($this->request->all(), $productId);
161
+        if ($result) {
162 162
             return ProductCombinationService::notificationRedirect(array('product-combination.index', $productId), $result, 'The product extra fields are updated.');
163 163
 
164 164
         }
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
     public function update($productId, $id)
196 196
     {
197 197
 
198
-        $result  = ProductCombinationService::updateById($this->request->all(), $productId, $id);
198
+        $result = ProductCombinationService::updateById($this->request->all(), $productId, $id);
199 199
         return ProductCombinationService::notificationRedirect(array('product-combination.index', $productId), $result, 'The product combinations are updated.');
200 200
 
201 201
     }
202 202
 
203 203
     public function destroy($productId, $id)
204 204
     {
205
-        $result  = ProductCombinationService::destroy($id);
205
+        $result = ProductCombinationService::destroy($id);
206 206
 
207 207
         if ($result) {
208 208
             Notification::success('The product combination is deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/AttributeController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
         if ($request->wantsJson()) {
31 31
 
32 32
             $query = AttributeService::getModel()
33
-            ->select(['id','value'])
33
+            ->select(['id', 'value'])
34 34
             ->where('attribute_group_id', '=', $attributeGroupId);
35 35
             
36 36
             $datatables = Datatables::of($query)
37
-            ->addColumn('action', function ($query) use ($attributeGroupId) {
37
+            ->addColumn('action', function($query) use ($attributeGroupId) {
38 38
                 $deleteLink = Form::deleteajax(url()->route('attribute.destroy', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
39 39
                 $links = ' <a href="'.url()->route('attribute.edit', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>'.$deleteLink;
40 40
                 return $links;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function store(Request $request, $attributeGroupId)
68 68
     {
69
-        $result  = AttributeService::create($request->all(), $attributeGroupId);
69
+        $result = AttributeService::create($request->all(), $attributeGroupId);
70 70
         return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was inserted.');
71 71
     }
72 72
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function update(Request $request, $attributeGroupId, $attributeId)
92 92
     {
93
-        $result  = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId);
93
+        $result = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId);
94 94
         return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was updated.');
95 95
     }
96 96
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function destroy($attributeGroupId, $attributeId)
104 104
     {
105
-        $result  = AttributeService::destroy($attributeId);
105
+        $result = AttributeService::destroy($attributeId);
106 106
 
107 107
         if ($result) {
108 108
             Notification::success('Atrribute was deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/DashboardController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function index()
12 12
     {
13
-        $shop  = auth('hideyobackend')->user()->shop;
13
+        $shop = auth('hideyobackend')->user()->shop;
14 14
 
15 15
         return view('backend.dashboard.stats')->with(
16 16
             array(
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductTagGroupController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
         if (Request::wantsJson()) {
24 24
 
25 25
             $query = ProductTagGroupService::getModel()
26
-            ->select(['id','tag'])
26
+            ->select(['id', 'tag'])
27 27
             ->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id);
28 28
             
29
-            $datatables = \Datatables::of($query)->addColumn('action', function ($query) {
29
+            $datatables = \Datatables::of($query)->addColumn('action', function($query) {
30 30
                 $deleteLink = \Form::deleteajax(url()->route('product-tag-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
31 31
                 $links = '<a href="'.url()->route('product-tag-group.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
32 32
             
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function store()
50 50
     {
51
-        $result  = ProductTagGroupService::create(\Request::all());
51
+        $result = ProductTagGroupService::create(\Request::all());
52 52
         return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was inserted.');
53 53
     }
54 54
 
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 
65 65
     public function update($productTagGroupId)
66 66
     {
67
-        $result  = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId);
67
+        $result = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId);
68 68
         return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was updated.');
69 69
     }
70 70
 
71 71
     public function destroy($productTagGroupId)
72 72
     {
73
-        $result  = ProductTagGroupService::destroy($productTagGroupId);
73
+        $result = ProductTagGroupService::destroy($productTagGroupId);
74 74
 
75 75
         if ($result) {
76 76
             Notification::success('The product group tag was deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ClientAddressController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
             ->addColumn('bill', function ($addresses) {
57 57
                 if ($addresses->clientBillAddress()->count()) {
58
-                          return '<span class="glyphicon glyphicon-ok icon-green"></span>';
58
+                            return '<span class="glyphicon glyphicon-ok icon-green"></span>';
59 59
                 }
60 60
 
61 61
                 return '<span class="glyphicon glyphicon-remove icon-red"></span>';
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
             )->with(array('clientDeliveryAddress', 'clientBillAddress'))->where('client_id', '=', $clientId);
37 37
             
38 38
             $datatables = Datatables::of($addresses)
39
-            ->addColumn('housenumber', function ($addresses) use ($clientId) {
39
+            ->addColumn('housenumber', function($addresses) use ($clientId) {
40 40
                 return $addresses->housenumber.$addresses->housenumber_suffix;
41 41
             })
42
-            ->addColumn('delivery', function ($addresses) {
42
+            ->addColumn('delivery', function($addresses) {
43 43
                 if ($addresses->clientDeliveryAddress()->count()) {
44 44
                     return '<span class="glyphicon glyphicon-ok icon-green"></span>';
45 45
                 }
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
                 
49 49
             })
50 50
 
51
-            ->addColumn('bill', function ($addresses) {
51
+            ->addColumn('bill', function($addresses) {
52 52
                 if ($addresses->clientBillAddress()->count()) {
53 53
                           return '<span class="glyphicon glyphicon-ok icon-green"></span>';
54 54
                 }
55 55
 
56 56
                 return '<span class="glyphicon glyphicon-remove icon-red"></span>';
57 57
             })
58
-            ->addColumn('action', function ($addresses) use ($clientId) {
58
+            ->addColumn('action', function($addresses) use ($clientId) {
59 59
                 $deleteLink = Form::deleteajax(url()->route('client.addresses.destroy', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
60 60
                 $links = '<a href="'.url()->route('client.addresses.edit', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
61 61
             
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
     public function store(Request $request, $clientId)
78 78
     {
79
-        $result  = ClientService::createAddress($request->all(), $clientId);
79
+        $result = ClientService::createAddress($request->all(), $clientId);
80 80
         return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is inserted.');
81 81
     }
82 82
 
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function update(Request $request, $clientId, $id)
90 90
     {
91
-        $result  = ClientService::editAddress($clientId, $id, $request->all());
91
+        $result = ClientService::editAddress($clientId, $id, $request->all());
92 92
         return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is updated.'); 
93 93
     }
94 94
 
95 95
     public function destroy($clientId, $id)
96 96
     {
97
-        $result  = ClientService::destroyAddress($id);
97
+        $result = ClientService::destroyAddress($id);
98 98
 
99 99
         if ($result) {
100 100
             Notification::success('The client address is deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/ProductAmountSeriesController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
             $query = $this->productAmountSeries->getModel()->select(
44
-                ['id', 'series_start', 'series_value', 'active','series_max']
44
+                ['id', 'series_start', 'series_value', 'active', 'series_max']
45 45
             )->where('product_id', '=', $productId);
46 46
             
47 47
             $datatables = Datatables::of($query)
48 48
 
49
-            ->addColumn('active', function ($query) {
49
+            ->addColumn('active', function($query) {
50 50
                 if ($query->active) {
51 51
                     return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>';
52 52
                 }
53 53
                 
54 54
                 return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-remove icon-red"></span></a>';
55 55
             })
56
-            ->addColumn('action', function ($query) use ($productId) {
56
+            ->addColumn('action', function($query) use ($productId) {
57 57
                 $deleteLink = Form::deleteajax(url()->route('product.product-amount-series.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
58 58
                 $links = '<a href="'.url()->route('product.product-amount-series.edit', array('productId' => $productId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>  '.$deleteLink;
59 59
                 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
     public function store(Request $request, $productId)
88 88
     {
89
-        $result  = $this->productAmountSeries->create($request->all(), $productId);
89
+        $result = $this->productAmountSeries->create($request->all(), $productId);
90 90
  
91 91
         if (isset($result->id)) {
92 92
             Notification::success('The product amount series is updated.');
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function update(Request $request, $productId, $id)
118 118
     {
119
-        $result  = $this->productAmountSeries->updateById($request->all(), $productId, $id);
119
+        $result = $this->productAmountSeries->updateById($request->all(), $productId, $id);
120 120
 
121 121
         if (!$result->id) {
122 122
             return redirect()->back()->withInput()->withErrors($result->errors()->all());
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
     public function destroy($productId, $id)
130 130
     {
131
-        $result  = $this->productAmountSeries->destroy($id);
131
+        $result = $this->productAmountSeries->destroy($id);
132 132
 
133 133
         if ($result) {
134 134
             Notification::success('The product amount series is deleted.');
Please login to merge, or discard this patch.
app/Http/Controllers/Backend/HtmlBlockController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
             
35 35
             $datatables = Datatables::of($query)
36 36
 
37
-            ->addColumn('active', function ($query) {
37
+            ->addColumn('active', function($query) {
38 38
                 if ($query->active) {
39 39
                     return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>';
40 40
                 }
41 41
                 return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-remove icon-red"></span></a>';
42 42
             })
43
-            ->addColumn('image', function ($query) {
43
+            ->addColumn('image', function($query) {
44 44
                 if ($query->image_file_name) {
45 45
                     return '<img src="'.config('hideyo.public_path').'/html_block/'.$query->id.'/'.$query->image_file_name.'" width="200px" />';
46 46
                 }
47 47
             })
48
-            ->addColumn('action', function ($query) {
48
+            ->addColumn('action', function($query) {
49 49
                 $deleteLink = Form::deleteajax(url()->route('html-block.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'));
50 50
                 $copy = '<a href="/admin/html-block/'.$query->id.'/copy" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>';
51 51
                 $links = '<a href="'.url()->route('html-block.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$copy.' '.$deleteLink;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     public function store()
67 67
     {
68
-        $result  = HtmlBlockService::create($this->request->all());
68
+        $result = HtmlBlockService::create($this->request->all());
69 69
         return HtmlBlockService::notificationRedirect('html-block.index', $result, 'The html block was inserted.');     
70 70
     }
71 71
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function update($htmlBlockId)
84 84
     {
85
-        $result  = HtmlBlockService::updateById($this->request->all(), $htmlBlockId);
85
+        $result = HtmlBlockService::updateById($this->request->all(), $htmlBlockId);
86 86
             return HtmlBlockService::notificationRedirect('html-block.index', $result, 'The html block was updated.');     
87 87
     }
88 88
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $htmlBlock = HtmlBlockService::find($htmlBlockId);
103 103
 
104
-        if($htmlBlock) {
105
-            $result  = HtmlBlockService::createCopy($this->request->all(), $htmlBlockId);
104
+        if ($htmlBlock) {
105
+            $result = HtmlBlockService::createCopy($this->request->all(), $htmlBlockId);
106 106
             return HtmlBlockService::notificationRedirect('html-block.index', $result, 'The html block was inserted.');      
107 107
         }
108 108
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
     public function destroy($htmlBlockId)
113 113
     {
114
-        $result  = HtmlBlockService::destroy($htmlBlockId);
114
+        $result = HtmlBlockService::destroy($htmlBlockId);
115 115
 
116 116
         if ($result) {
117 117
             Notification::success('The html block was deleted.');
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
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
                 ['product.*', 
41 41
                 'brand.title as brandtitle', 
42 42
                 'product_category.title as categorytitle']
43
-            )->with(array('productCategory', 'brand', 'subcategories', 'attributes',  'productImages','taxRate'))
43
+            )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate'))
44 44
 
45 45
             ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id')
46 46
 
@@ -49,23 +49,23 @@  discard block
 block discarded – undo
49 49
             ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id);
50 50
             
51 51
             $datatables = \Datatables::of($product)
52
-            ->filterColumn('reference_code', function ($query, $keyword) {
52
+            ->filterColumn('reference_code', function($query, $keyword) {
53 53
                 $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]);
54 54
             })
55
-            ->filterColumn('active', function ($query, $keyword) {
55
+            ->filterColumn('active', function($query, $keyword) {
56 56
                 $query->whereRaw("product.active like ?", ["%{$keyword}%"]);
57 57
                 ;
58 58
             })
59 59
 
60
-            ->addColumn('rank', function ($product) {
60
+            ->addColumn('rank', function($product) {
61 61
                 return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">';
62 62
               
63 63
             })
64 64
 
65
-            ->filterColumn('title', function ($query, $keyword) {
65
+            ->filterColumn('title', function($query, $keyword) {
66 66
 
67 67
                 $query->where(
68
-                    function ($query) use ($keyword) {
68
+                    function($query) use ($keyword) {
69 69
                         $query->whereRaw("product.title like ?", ["%{$keyword}%"]);
70 70
                         $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]);
71 71
                              $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]);
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
                 );
75 75
             })
76 76
 
77
-            ->filterColumn('categorytitle', function ($query, $keyword) {
77
+            ->filterColumn('categorytitle', function($query, $keyword) {
78 78
                 $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]);
79 79
             })
80 80
 
81
-            ->addColumn('active', function ($product) {
81
+            ->addColumn('active', function($product) {
82 82
                 if ($product->active) {
83 83
                     return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-ok icon-green"></span></a>';
84 84
                 }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-remove icon-red"></span></a>';
87 87
             })
88 88
 
89
-            ->addColumn('title', function ($product) {
89
+            ->addColumn('title', function($product) {
90 90
                 if ($product->brand) {
91 91
                     return $product->brand->title.' | '.$product->title;
92 92
                 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             })
96 96
 
97 97
 
98
-            ->addColumn('amount', function ($product) {
98
+            ->addColumn('amount', function($product) {
99 99
                 if ($product->attributes->count()) {
100 100
                     return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>';
101 101
                 }
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
                 return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">';
104 104
             })
105 105
 
106
-            ->addColumn('image', function ($product) {
106
+            ->addColumn('image', function($product) {
107 107
                 if ($product->productImages->count()) {
108 108
                     return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'"  />';
109 109
                 }
110 110
             })
111
-            ->addColumn('price', function ($product) {
111
+            ->addColumn('price', function($product) {
112 112
 
113 113
                 $result = "";
114 114
                 if ($product->price) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         'amount' => $product->amount
159 159
                         );
160 160
 
161
-                    $result =  '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
161
+                    $result = '&euro; '.$output['orginal_price_ex_tax_number_format'].' / &euro; '.$output['orginal_price_inc_tax_number_format'];
162 162
 
163 163
 
164 164
                     if ($product->discount_value) {
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             })
171 171
 
172 172
 
173
-            ->addColumn('categorytitle', function ($product) {
173
+            ->addColumn('categorytitle', function($product) {
174 174
                 if ($product->subcategories()->count()) {
175 175
                     $subcategories = $product->subcategories()->pluck('title')->toArray();
176 176
                     return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 return $product->categorytitle;
180 180
             })
181 181
 
182
-            ->addColumn('action', function ($product) {
182
+            ->addColumn('action', function($product) {
183 183
                 $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title);
184 184
                 $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>';
185 185
 
@@ -202,26 +202,26 @@  discard block
 block discarded – undo
202 202
                 ['product.*', 
203 203
                 'brand.title as brandtitle', 
204 204
                 'product_category.title as categorytitle']
205
-            )->with(array('productCategory', 'brand', 'subcategories', 'attributes',  'productImages','taxRate'))
205
+            )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate'))
206 206
             ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id')
207 207
             ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id')
208 208
             ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id);
209 209
             
210 210
             $datatables = \Datatables::of($product)
211
-            ->addColumn('rank', function ($product) {
211
+            ->addColumn('rank', function($product) {
212 212
                 return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">';
213 213
             })
214
-            ->filterColumn('categorytitle', function ($query, $keyword) {
214
+            ->filterColumn('categorytitle', function($query, $keyword) {
215 215
                 $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]);
216 216
             })
217
-            ->addColumn('title', function ($product) {
217
+            ->addColumn('title', function($product) {
218 218
                 if ($product->brand) {
219 219
                     return $product->brand->title.' | '.$product->title;
220 220
                 }
221 221
                 
222 222
                 return $product->title;      
223 223
             })
224
-            ->addColumn('categorytitle', function ($product) {
224
+            ->addColumn('categorytitle', function($product) {
225 225
                 if ($product->subcategories()->count()) {
226 226
                     $subcategories = $product->subcategories()->pluck('title')->toArray();
227 227
                     return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>';
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
     public function store()
252 252
     {
253
-        $result  = ProductService::create($this->request->all());
253
+        $result = ProductService::create($this->request->all());
254 254
         return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.');
255 255
     }
256 256
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
     public function postExport()
296 296
     {
297 297
 
298
-        $result  =  ProductService::selectAllExport();
299
-        Excel::create('export', function ($excel) use ($result) {
298
+        $result = ProductService::selectAllExport();
299
+        Excel::create('export', function($excel) use ($result) {
300 300
 
301
-            $excel->sheet('Products', function ($sheet) use ($result) {
301
+            $excel->sheet('Products', function($sheet) use ($result) {
302 302
                 $newArray = array();
303 303
                 foreach ($result as $row) {
304 304
                     $category = "";
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                         $i = 0;
328 328
                         foreach ($row->productImages as $image) {
329 329
                             $i++;
330
-                            $newArray[$row->id]['image_'.$i] =  url('/').'/files/product/800x800/'.$row->id.'/'.$image->file;
330
+                            $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file;
331 331
                         }
332 332
                     }
333 333
                 }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
     {
399 399
 
400 400
         $input = $this->request->all();
401
-        $result  = ProductService::updateById($input, $productId);
401
+        $result = ProductService::updateById($input, $productId);
402 402
 
403 403
         $redirect = redirect()->route('product.index');
404 404
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
     public function destroy($id)
430 430
     {
431
-        $result  = ProductService::destroy($id);
431
+        $result = ProductService::destroy($id);
432 432
 
433 433
         if ($result) {
434 434
             Notification::success('The product was deleted.');
Please login to merge, or discard this patch.