Completed
Push — development ( 3e307e...0dc251 )
by Ashutosh
11:44
created
app/Model/Common/State.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
         'state_subdivision_id', 'country_code_char2', 
14 14
         'country_code_char3', 'state_subdivision_name', 
15 15
         'state_subdivision_alternate_names', 'primary_level_name',
16
-         'state_subdivision_code',
16
+            'state_subdivision_code',
17 17
     ];
18 18
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CheckoutController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                     ], [
119 119
                 'domain.*.required' => 'Please provide Domain name',
120 120
                 //'domain.*.url'      => 'Domain name is not valid',
121
-                       ]);
121
+                        ]);
122 122
         }
123 123
 
124 124
         try {
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
             $items = \Cart::getContent();
328 328
             foreach ($items as $item) {
329 329
 
330
-               //this is product
330
+                //this is product
331 331
                 $id = $item->id;
332 332
                 $this->AddProductToOrder($id);
333 333
             }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                 $ends_at = '';
388 388
             }
389 389
             $this->subscription->create(['user_id' => \Auth::user()->id,
390
-             'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at]);
390
+                'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at]);
391 391
         } catch (\Exception $ex) {
392 392
             app('log')->useDailyFiles(storage_path().'/logs/laravel.log');
393 393
             app('log')->info($ex->getMessage());
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
             $invoiceItem = $this->invoiceItem->create(['invoice_id' => $invoiceid, 
442 442
                 'product_name' => $product_name, 'regular_price' => $regular_price, 
443 443
                 'quantity' => $quantity, 'tax_name' => $tax_name,
444
-                 'tax_percentage' => $tax_percentage, 'subtotal' => $subtotal]);
444
+                    'tax_percentage' => $tax_percentage, 'subtotal' => $subtotal]);
445 445
         } catch (\Exception $ex) {
446 446
             app('log')->useDailyFiles(storage_path().'/logs/laravel.log');
447 447
             app('log')->info($ex->getMessage());
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         try {
130 130
             $versions = ProductUpload::where('product_id', $productid)
131 131
             ->select('id', 'product_id', 'version',
132
-             'title', 'description', 'file', 'created_at')->get();
132
+                'title', 'description', 'file', 'created_at')->get();
133 133
 
134 134
             return \DataTables::of($versions)
135 135
                             ->addColumn('id', function ($versions) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             $products = $this->product::where('id', $productid)
186 186
             ->select('name', 'version', 'github_owner', 'github_repository')->get();
187 187
             $owner = '';  $repo = '';
188
-           foreach ($products as $product) {
188
+            foreach ($products as $product) {
189 189
                 $owner = $product->github_owner;
190 190
                 $repo = $product->github_repository;
191 191
             }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                             })
203 203
                             ->addColumn('description', function ($link) {
204 204
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
205
-                                 return $markdown;
205
+                                    return $markdown;
206 206
                             })
207 207
                             ->addColumn('file', function ($link) use ($invoiceid, $productid) {
208 208
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray();
313 313
 
314 314
             return view('themes.default1.front.clients.profile',
315
-             compact('user', 'timezones', 'state', 'states', 'bussinesses'));
315
+                compact('user', 'timezones', 'state', 'states', 'bussinesses'));
316 316
         } catch (Exception $ex) {
317 317
             Bugsnag::notifyException($ex);
318 318
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                                 return $model->grand_total;
392 392
                             })
393 393
                             ->rawColumns(['checkbox', 'number', 'total',
394
-                             'payment_method', 'payment_status', 'created_at', ])
394
+                                'payment_method', 'payment_status', 'created_at', ])
395 395
                             ->make(true);
396 396
         } catch (Exception $ex) {
397 397
             Bugsnag::notifyException($ex);
@@ -417,17 +417,17 @@  discard block
 block discarded – undo
417 417
                             ->addColumn('number', function ($model) {
418 418
                                 return $model->invoice()->first()->number;
419 419
                             })
420
-                              ->addColumn('total', function ($model) {
421
-                                  return $model->amount;
422
-                              })
423
-                               ->addColumn('created_at', function ($model) {
424
-                                   $date1 = new DateTime($model->created_at);
425
-                                   $tz = \Auth::user()->timezone()->first()->name;
426
-                                   $date1->setTimezone(new DateTimeZone($tz));
427
-                                   $date = $date1->format('M j, Y, g:i a');
428
-
429
-                                   return $date;
430
-                               })
420
+                                ->addColumn('total', function ($model) {
421
+                                    return $model->amount;
422
+                                })
423
+                                ->addColumn('created_at', function ($model) {
424
+                                    $date1 = new DateTime($model->created_at);
425
+                                    $tz = \Auth::user()->timezone()->first()->name;
426
+                                    $date1->setTimezone(new DateTimeZone($tz));
427
+                                    $date = $date1->format('M j, Y, g:i a');
428
+
429
+                                    return $date;
430
+                                })
431 431
 
432 432
                             ->addColumn('payment_method', 'payment_status', 'created_at')
433 433
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
                     ->select('number', 'created_at', 'grand_total', 'id', 'status');
78 78
 
79 79
             return \DataTables::of($invoices->get())
80
-                            ->addColumn('number', function ($model) {
80
+                            ->addColumn('number', function($model) {
81 81
                                 return $model->number;
82 82
                             })
83
-                            ->addColumn('date', function ($model) {
83
+                            ->addColumn('date', function($model) {
84 84
                                 $date = $model->created_at;
85 85
 
86 86
                                 return $date;
87 87
                                 // $myobject->created_at->timezone($this->auth->user()->timezone);
88 88
                             })
89 89
                             // ->showColumns('created_at')
90
-                            ->addColumn('total', function ($model) {
90
+                            ->addColumn('total', function($model) {
91 91
                                 return $model->grand_total;
92 92
                             })
93
-                            ->addColumn('Action', function ($model) {
93
+                            ->addColumn('Action', function($model) {
94 94
                                 $status = $model->status;
95 95
                                 $payment = '';
96 96
                                 if ($status == 'Pending' && $model->grand_total > 0) {
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
              'title', 'description', 'file', 'created_at')->get();
133 133
 
134 134
             return \DataTables::of($versions)
135
-                            ->addColumn('id', function ($versions) {
135
+                            ->addColumn('id', function($versions) {
136 136
                                 return ucfirst($versions->id);
137 137
                             })
138
-                            ->addColumn('version', function ($versions) {
138
+                            ->addColumn('version', function($versions) {
139 139
                                 return ucfirst($versions->version);
140 140
                             })
141
-                            ->addColumn('title', function ($versions) {
141
+                            ->addColumn('title', function($versions) {
142 142
                                 return ucfirst($versions->title);
143 143
                             })
144
-                            ->addColumn('description', function ($versions) {
144
+                            ->addColumn('description', function($versions) {
145 145
                                 return ucfirst($versions->description);
146 146
                             })
147
-                            ->addColumn('file', function ($versions) use ($clientid, $invoiceid, $productid) {
147
+                            ->addColumn('file', function($versions) use ($clientid, $invoiceid, $productid) {
148 148
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
149 149
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
150 150
                                 $order_id = $order->id;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         try {
185 185
             $products = $this->product::where('id', $productid)
186 186
             ->select('name', 'version', 'github_owner', 'github_repository')->get();
187
-            $owner = '';  $repo = '';
187
+            $owner = ''; $repo = '';
188 188
            foreach ($products as $product) {
189 189
                 $owner = $product->github_owner;
190 190
                 $repo = $product->github_repository;
@@ -194,17 +194,17 @@  discard block
 block discarded – undo
194 194
             $link = $link['body'];
195 195
             $link = (array_slice($link, 0, 10, true));
196 196
             return \DataTables::of($link)
197
-                            ->addColumn('version', function ($link) {
197
+                            ->addColumn('version', function($link) {
198 198
                                 return ucfirst($link['tag_name']);
199 199
                             })
200
-                            ->addColumn('name', function ($link) {
200
+                            ->addColumn('name', function($link) {
201 201
                                 return ucfirst($link['name']);
202 202
                             })
203
-                            ->addColumn('description', function ($link) {
203
+                            ->addColumn('description', function($link) {
204 204
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
205 205
                                  return $markdown;
206 206
                             })
207
-                            ->addColumn('file', function ($link) use ($invoiceid, $productid) {
207
+                            ->addColumn('file', function($link) use ($invoiceid, $productid) {
208 208
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
209 209
                                 $order_id = $order->id;
210 210
                                 $orderEndDate = Subscription::select('ends_at')
@@ -249,20 +249,20 @@  discard block
 block discarded – undo
249 249
             $orders = Order::where('client', \Auth::user()->id);
250 250
 
251 251
             return \DataTables::of($orders->get())
252
-                            ->addColumn('id', function ($model) {
252
+                            ->addColumn('id', function($model) {
253 253
                                 return $model->id;
254 254
                             })
255
-                            ->addColumn('product_name', function ($model) {
255
+                            ->addColumn('product_name', function($model) {
256 256
                                 return $model->product()->first()->name;
257 257
                             })
258
-                            ->addColumn('expiry', function ($model) {
258
+                            ->addColumn('expiry', function($model) {
259 259
                                 $tz = \Auth::user()->timezone()->first()->name;
260 260
                                 $end = $this->getExpiryDate($model);
261 261
 
262 262
                                 return $end;
263 263
                             })
264 264
 
265
-                            ->addColumn('Action', function ($model) {
265
+                            ->addColumn('Action', function($model) {
266 266
                                 $sub = $model->subscription()->first();
267 267
                                 $order = Order::where('id', $model->id)->select('product')->first();
268 268
                                 $productid = $order->product;
@@ -377,17 +377,17 @@  discard block
 block discarded – undo
377 377
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
378 378
 
379 379
             return \DataTables::of($payments->get())
380
-                            ->addColumn('checkbox', function ($model) {
380
+                            ->addColumn('checkbox', function($model) {
381 381
                                 if (\Input::get('client') != 'true') {
382 382
                                     return "<input type='checkbox' class='payment_checkbox' 
383 383
                                     value=".$model->id.' name=select[] id=check>';
384 384
                                 }
385 385
                             })
386
-                            ->addColumn('number', function ($model) {
386
+                            ->addColumn('number', function($model) {
387 387
                                 return $model->invoice()->first()->number;
388 388
                             })
389 389
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
390
-                            ->addColumn('total', function ($model) {
390
+                            ->addColumn('total', function($model) {
391 391
                                 return $model->grand_total;
392 392
                             })
393 393
                             ->rawColumns(['checkbox', 'number', 'total',
@@ -414,13 +414,13 @@  discard block
 block discarded – undo
414 414
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
415 415
             //dd(\Input::all());
416 416
             return \DataTables::of($payments->get())
417
-                            ->addColumn('number', function ($model) {
417
+                            ->addColumn('number', function($model) {
418 418
                                 return $model->invoice()->first()->number;
419 419
                             })
420
-                              ->addColumn('total', function ($model) {
420
+                              ->addColumn('total', function($model) {
421 421
                                   return $model->amount;
422 422
                               })
423
-                               ->addColumn('created_at', function ($model) {
423
+                               ->addColumn('created_at', function($model) {
424 424
                                    $date1 = new DateTime($model->created_at);
425 425
                                    $tz = \Auth::user()->timezone()->first()->name;
426 426
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CartController.php 2 patches
Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -197,149 +197,149 @@  discard block
 block discarded – undo
197 197
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
198 198
 
199 199
                 if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table)
200
-                   if ($tax_enable == 1) {//If GST is Enabled
201
-
202
-                       $state_code = '';
203
-                       $c_gst = '';
204
-                       $s_gst = '';
205
-                       $i_gst = '';
206
-                       $ut_gst = '';
207
-                       $value = '';
208
-                       $rate = '';
209
-                       $status = 1;
210
-
211
-                       if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
212
-                           $c_gst = $user_state->c_gst;
213
-                           $s_gst = $user_state->s_gst;
214
-                           $i_gst = $user_state->i_gst;
215
-                           $ut_gst = $user_state->ut_gst;
216
-                           $state_code = $user_state->state_code;
217
-
218
-                           if ($state_code == $origin_state) {//If user and origin state are same
219
-                               $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
200
+                    if ($tax_enable == 1) {//If GST is Enabled
201
+
202
+                        $state_code = '';
203
+                        $c_gst = '';
204
+                        $s_gst = '';
205
+                        $i_gst = '';
206
+                        $ut_gst = '';
207
+                        $value = '';
208
+                        $rate = '';
209
+                        $status = 1;
210
+
211
+                        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
212
+                            $c_gst = $user_state->c_gst;
213
+                            $s_gst = $user_state->s_gst;
214
+                            $i_gst = $user_state->i_gst;
215
+                            $ut_gst = $user_state->ut_gst;
216
+                            $state_code = $user_state->state_code;
217
+
218
+                            if ($state_code == $origin_state) {//If user and origin state are same
219
+                                $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
220 220
                                 $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
221 221
 
222
-                               $taxes = $rateForSameState['taxes'];
223
-                               $status = $rateForSameState['status'];
224
-                               $value = $rateForSameState['value'];
225
-                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
226
-                               $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
222
+                                $taxes = $rateForSameState['taxes'];
223
+                                $status = $rateForSameState['status'];
224
+                                $value = $rateForSameState['value'];
225
+                            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
226
+                                $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
227 227
                                 $origin_state, $productid, $i_gst, $state_code, $status);
228
-                               $taxes = $rateForOtherState['taxes'];
229
-                               $status = $rateForOtherState['status'];
230
-                               $value = $rateForOtherState['value'];
231
-                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
232
-                               $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
228
+                                $taxes = $rateForOtherState['taxes'];
229
+                                $status = $rateForOtherState['status'];
230
+                                $value = $rateForOtherState['value'];
231
+                            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
232
+                                $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
233 233
                                 $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
234
-                               $taxes = $rateForUnionTerritory['taxes'];
235
-                               $status = $rateForUnionTerritory['status'];
236
-                               $value = $rateForUnionTerritory['value'];
237
-                           }
238
-                       } else {//If user from other Country
239
-                           $taxClassId = Tax::where('state', $geoip_state)
240
-                           ->orWhere('country', $geoip_country)
241
-                           ->pluck('tax_classes_id')->first();
242
-                           if ($taxClassId) { //if state equals the user State or country equals user country
243
-                               $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
234
+                                $taxes = $rateForUnionTerritory['taxes'];
235
+                                $status = $rateForUnionTerritory['status'];
236
+                                $value = $rateForUnionTerritory['value'];
237
+                            }
238
+                        } else {//If user from other Country
239
+                            $taxClassId = Tax::where('state', $geoip_state)
240
+                            ->orWhere('country', $geoip_country)
241
+                            ->pluck('tax_classes_id')->first();
242
+                            if ($taxClassId) { //if state equals the user State or country equals user country
243
+                                $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
244 244
                                 $productid, $status);
245
-                               $taxes = $taxForSpecificCountry['taxes'];
246
-                               $status = $taxForSpecificCountry['status'];
247
-                               $value = $taxForSpecificCountry['value'];
248
-                               $rate = $taxForSpecificCountry['value'];
249
-                           } else {//if Tax is selected for Any Country Any State
250
-                               $taxClassId = Tax::where('country', '')
251
-                               ->where('state', 'Any State')
252
-                               ->pluck('tax_classes_id')->first();
253
-                               if ($taxClassId) {
254
-                                   $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status);
255
-                                   $taxes = $taxForAnyCountry['taxes'];
256
-                                   $status = $taxForAnyCountry['status'];
257
-                                   $value = $taxForAnyCountry['value'];
258
-                                   $rate = $taxForAnyCountry['value'];
259
-                               } else {
260
-                                   $taxes = [0];
261
-                               }
262
-                           }
263
-                       }
264
-                       foreach ($taxes as $key => $tax) {
245
+                                $taxes = $taxForSpecificCountry['taxes'];
246
+                                $status = $taxForSpecificCountry['status'];
247
+                                $value = $taxForSpecificCountry['value'];
248
+                                $rate = $taxForSpecificCountry['value'];
249
+                            } else {//if Tax is selected for Any Country Any State
250
+                                $taxClassId = Tax::where('country', '')
251
+                                ->where('state', 'Any State')
252
+                                ->pluck('tax_classes_id')->first();
253
+                                if ($taxClassId) {
254
+                                    $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status);
255
+                                    $taxes = $taxForAnyCountry['taxes'];
256
+                                    $status = $taxForAnyCountry['status'];
257
+                                    $value = $taxForAnyCountry['value'];
258
+                                    $rate = $taxForAnyCountry['value'];
259
+                                } else {
260
+                                    $taxes = [0];
261
+                                }
262
+                            }
263
+                        }
264
+                        foreach ($taxes as $key => $tax) {
265 265
 
266 266
                                     //All the da a attribute that is sent to the checkout Page if tax_compound=0
267
-                           if ($taxes[0]) {
268
-                               $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
269
-                               's_gst'                        => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
267
+                            if ($taxes[0]) {
268
+                                $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
269
+                                's_gst'                        => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
270 270
                                 'state'                       => $state_code, 'origin_state'=>$origin_state,
271
-                                 'tax_enable'                 => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
271
+                                    'tax_enable'                 => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
272 272
 
273
-                               $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
273
+                                $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
274 274
 
275 275
                                             'name'   => 'no compound',
276 276
                                             'type'   => 'tax',
277 277
                                             'target' => 'item',
278 278
                                             'value'  => $value,
279
-                                          ]);
280
-                           } else {
281
-                               $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
282
-                               $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
283
-                                           'name'   => 'null',
284
-                                           'type'   => 'tax',
285
-                                           'target' => 'item',
286
-                                           'value'  => '0%',
287
-                                         ]);
288
-                           }
289
-                       }
290
-                   } elseif ($tax_enable == 0) {//If Tax enable is 0
291
-                       $status = 1;
292
-                       if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
293
-                           $taxClassId = Tax::where('country', '')
294
-                           ->where('state', 'Any State')
295
-                           ->pluck('tax_classes_id')->first(); //In case of India when
296
-                           // other tax is available and tax is not enabled
297
-                           if ($taxClassId) {
298
-                               $taxes = $this->getTaxByPriority($taxClassId);
299
-                               $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
300
-                               if ($value == 0) {
301
-                                   $status = 0;
302
-                               }
303
-                               $rate = $value;
304
-                               foreach ($taxes as $key => $tax) {
305
-                                   $tax_attribute[$key] = ['name' => $tax->name,
306
-                                   'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
307
-                                   $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
279
+                                            ]);
280
+                            } else {
281
+                                $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
282
+                                $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
283
+                                            'name'   => 'null',
284
+                                            'type'   => 'tax',
285
+                                            'target' => 'item',
286
+                                            'value'  => '0%',
287
+                                            ]);
288
+                            }
289
+                        }
290
+                    } elseif ($tax_enable == 0) {//If Tax enable is 0
291
+                        $status = 1;
292
+                        if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
293
+                            $taxClassId = Tax::where('country', '')
294
+                            ->where('state', 'Any State')
295
+                            ->pluck('tax_classes_id')->first(); //In case of India when
296
+                            // other tax is available and tax is not enabled
297
+                            if ($taxClassId) {
298
+                                $taxes = $this->getTaxByPriority($taxClassId);
299
+                                $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
300
+                                if ($value == 0) {
301
+                                    $status = 0;
302
+                                }
303
+                                $rate = $value;
304
+                                foreach ($taxes as $key => $tax) {
305
+                                    $tax_attribute[$key] = ['name' => $tax->name,
306
+                                    'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
307
+                                    $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
308 308
 
309 309
                                             'name'   => $tax->name,
310 310
                                             'type'   => 'tax',
311 311
                                             'target' => 'item',
312 312
                                             'value'  => $value,
313 313
                                         ]);
314
-                               }
315
-                           } else {//In case of other country
316
-                               //when tax is available and tax is not enabled
317
-                               //(Applicable when Global Tax class for any country and state is not there)
318
-                               $taxClassId = Tax::where('state', $geoip_state)
319
-                               ->orWhere('country', $geoip_country)
320
-                               ->pluck('tax_classes_id')->first();
321
-                               if ($taxClassId) { //if state equals the user State
322
-                                   $taxes = $this->getTaxByPriority($taxClassId);
323
-                                   $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
324
-                                   if ($value == '') {
325
-                                       $status = 0;
326
-                                   }
327
-                                   $rate = $value;
328
-                               }
329
-                               foreach ($taxes as $key => $tax) {
330
-                                   $tax_attribute[$key] = ['name' => $tax->name,
331
-                                   'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
332
-                                   $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
314
+                                }
315
+                            } else {//In case of other country
316
+                                //when tax is available and tax is not enabled
317
+                                //(Applicable when Global Tax class for any country and state is not there)
318
+                                $taxClassId = Tax::where('state', $geoip_state)
319
+                                ->orWhere('country', $geoip_country)
320
+                                ->pluck('tax_classes_id')->first();
321
+                                if ($taxClassId) { //if state equals the user State
322
+                                    $taxes = $this->getTaxByPriority($taxClassId);
323
+                                    $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
324
+                                    if ($value == '') {
325
+                                        $status = 0;
326
+                                    }
327
+                                    $rate = $value;
328
+                                }
329
+                                foreach ($taxes as $key => $tax) {
330
+                                    $tax_attribute[$key] = ['name' => $tax->name,
331
+                                    'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
332
+                                    $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
333 333
 
334 334
                                             'name'   => $tax->name,
335 335
                                             'type'   => 'tax',
336 336
                                             'target' => 'item',
337 337
                                             'value'  => $value,
338 338
                                         ]);
339
-                               }
340
-                           }
341
-                       }
342
-                   }
339
+                                }
340
+                            }
341
+                        }
342
+                    }
343 343
                 } else {
344 344
                     $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
345 345
                     $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
@@ -418,14 +418,14 @@  discard block
 block discarded – undo
418 418
         $value = '';
419 419
         $value = $taxes->toArray()[0]['active'] ?
420 420
              (TaxProductRelation::where('product_id', $productid)
421
-              ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
421
+                ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
422 422
 
423 423
         return $value;
424 424
     }
425 425
 
426 426
     public function otherRate($productid)
427 427
     {
428
-         $otherRate = '';
428
+            $otherRate = '';
429 429
 
430 430
         return $otherRate;
431 431
     }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $otherRate = 0;
436 436
         $status = $taxes->toArray()[0]['active'];
437 437
         if ($status && (TaxProductRelation::where('product_id', $productid)
438
-          ->where('tax_class_id', $taxClassId)->count() > 0)) {
438
+            ->where('tax_class_id', $taxClassId)->count() > 0)) {
439 439
             $otherRate = Tax::where('tax_classes_id', $taxClassId)->first()->rate;
440 440
         }
441 441
 
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
             if ($subregion) {
722 722
                 $result = ['id' => $subregion->state_subdivision_code,
723 723
 
724
-                     'name' => $subregion->state_subdivision_name, ];
724
+                        'name' => $subregion->state_subdivision_name, ];
725 725
             }
726 726
 
727 727
             return $result;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         }
72 72
 
73 73
         $country = $this->findCountryByGeoip($location['countryCode']);
74
-        $states =  $this->findStateByRegionId($location['countryCode']);
74
+        $states = $this->findStateByRegionId($location['countryCode']);
75 75
         $states = \App\Model\Common\State::pluck('state_subdivision_name', 'state_subdivision_code')->toArray();
76 76
         $state_code = $location['countryCode'].'-'.$location['region'];
77 77
         $state = $this->getStateByCode($state_code);
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
 
122 122
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
123 123
                         })
124
-                         ->addColumn('number', function ($model) {
125
-                             return ucfirst($model->number);
126
-                         })
124
+                            ->addColumn('number', function ($model) {
125
+                                return ucfirst($model->number);
126
+                            })
127 127
 
128 128
                         ->addColumn('date', function ($model) {
129 129
                             $date = date_create($model->created_at);
130 130
 
131 131
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
132 132
                         })
133
-                         ->addColumn('grand_total', function ($model) {
134
-                             return ucfirst($model->number);
135
-                         })
136
-                          ->addColumn('status', function ($model) {
137
-                              return ucfirst($model->status);
138
-                          })
133
+                            ->addColumn('grand_total', function ($model) {
134
+                                return ucfirst($model->number);
135
+                            })
136
+                            ->addColumn('status', function ($model) {
137
+                                return ucfirst($model->status);
138
+                            })
139 139
 
140 140
                         ->addColumn('action', function ($model) {
141 141
                             $action = '';
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                                     ."   $action";
155 155
                         })
156 156
 
157
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
157
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
158 158
                         ->make(true);
159 159
     }
160 160
 
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
             $symbol = $attributes[0]['currency'][0]['code'];
284 284
             //dd($symbol);
285 285
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
286
-             'date' => $date, 'grand_total' => $grand_total, 'status' => 'pending', 
287
-             'currency' => $symbol]);
286
+                'date' => $date, 'grand_total' => $grand_total, 'status' => 'pending', 
287
+                'currency' => $symbol]);
288 288
 
289 289
             foreach (\Cart::getContent() as $cart) {
290 290
                 $this->createInvoiceItems($invoice->id, $cart);
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
481 481
 
482 482
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
483
-                     ->pluck('tax_classes_id')->first(); //In case of India when
483
+                        ->pluck('tax_classes_id')->first(); //In case of India when
484 484
                     //other tax is available and tax is not enabled
485 485
                     if ($taxClassId) {
486 486
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -549,10 +549,10 @@  discard block
 block discarded – undo
549 549
         foreach ($taxes as $key => $tax) {
550 550
             if ($taxes[0]) {
551 551
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
552
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
553
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
554
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
555
-                  'origin_state'               => $origin_state, ];
552
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
553
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
554
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
555
+                    'origin_state'               => $origin_state, ];
556 556
 
557 557
                 $rate = $tax->rate;
558 558
 
@@ -761,8 +761,8 @@  discard block
 block discarded – undo
761 761
                 }
762 762
 
763 763
                 return view('themes.default1.invoice.payment',
764
-                 compact('invoice_status', 'payment_status',
765
-                  'payment_method', 'invoice_id', 'domain', 'invoice'));
764
+                    compact('invoice_status', 'payment_status',
765
+                    'payment_method', 'invoice_id', 'domain', 'invoice'));
766 766
             }
767 767
 
768 768
             return redirect()->back();
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
                 case 1:
801 801
                     $percentage = $price * ($value / 100);
802 802
 
803
-                     return $price - $percentage;
803
+                        return $price - $percentage;
804 804
                 case 2:
805 805
                     return $price - $value;
806 806
                 case 3:
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
             $payment_date = \Carbon\Carbon::now()->toDateTimeString();
819 819
             $amount = $grand_total;
820 820
             $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method,
821
-             $payment_status, $payment_date, $amount);
821
+                $payment_status, $payment_date, $amount);
822 822
 
823 823
             return redirect()->back()->with('success', 'Payment Accepted Successfully');
824 824
         } catch (\Exception $ex) {
Please login to merge, or discard this patch.
app/Http/Controllers/Common/SocialMediaController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
 
192 192
             // Migrate over to SSL/TLS
193 193
             // Load the Tweets
194
-               $tweets = $twitter->get('statuses/user_timeline', 
194
+                $tweets = $twitter->get('statuses/user_timeline', 
195 195
                 ['screen_name' => $username, 'exclude_replies' => 'true', 
196 196
                 'include_rts' => 'false', 'count' => $tweet_limit]);
197 197
 
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                                 return ucfirst($model->name);
116 116
                             })
117 117
                             ->addColumn('type', function ($model) {
118
-                                 if ($this->type->where('id', $model->type)->first()) {
118
+                                    if ($this->type->where('id', $model->type)->first()) {
119 119
                                     return $this->type->where('id', $model->type)->first()->name;
120 120
                                 } else {
121 121
                                     return 'Not available';
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                         'type'    => 'required',
343 343
                         'group'   => 'required',
344 344
                         'image'   => 'sometimes | mimes:jpeg,jpg,png,gif | max:1000',
345
-      ]);
345
+        ]);
346 346
 
347 347
             if ($v->fails()) {
348 348
                 return redirect()->back()->with('errors', $v->errors());
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -107,42 +107,42 @@
 block discarded – undo
107 107
 
108 108
                 return\ DataTables::of($new_product)
109 109
 
110
-                            ->addColumn('checkbox', function ($model) {
110
+                            ->addColumn('checkbox', function($model) {
111 111
                                 return "<input type='checkbox' class='product_checkbox' 
112 112
                                 value=".$model->id.' name=select[] id=check>';
113 113
                             })
114
-                            ->addColumn('name', function ($model) {
114
+                            ->addColumn('name', function($model) {
115 115
                                 return ucfirst($model->name);
116 116
                             })
117
-                            ->addColumn('type', function ($model) {
117
+                            ->addColumn('type', function($model) {
118 118
                                  if ($this->type->where('id', $model->type)->first()) {
119 119
                                     return $this->type->where('id', $model->type)->first()->name;
120 120
                                 } else {
121 121
                                     return 'Not available';
122 122
                                 }
123 123
                             })
124
-                            ->addColumn('group', function ($model) {
124
+                            ->addColumn('group', function($model) {
125 125
                                 if ($this->group->where('id', $model->group)->first()) {
126 126
                                     return $this->group->where('id', $model->group)->first()->name;
127 127
                                 } else {
128 128
                                     return 'Not available';
129 129
                                 }
130 130
                             })
131
-                            ->addColumn('price', function ($model) {
131
+                            ->addColumn('price', function($model) {
132 132
                                 if ($this->price->where('product_id', $model->id)->first()) {
133 133
                                     return $this->price->where('product_id', $model->id)->first()->price;
134 134
                                 } else {
135 135
                                     return 'Not available';
136 136
                                 }
137 137
                             })
138
-                            ->addColumn('currency', function ($model) {
138
+                            ->addColumn('currency', function($model) {
139 139
                                 if ($this->price->where('product_id', $model->id)->first()) {
140 140
                                     return $this->price->where('product_id', $model->id)->first()->currency;
141 141
                                 } else {
142 142
                                     return 'Not available';
143 143
                                 }
144 144
                             })
145
-                            ->addColumn('Action', function ($model) {
145
+                            ->addColumn('Action', function($model) {
146 146
                                 $url = '';
147 147
                                 if ($model->type == 2) {
148 148
                                     $url = '<a href='.url('product/download/'.$model->id).
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ExtendedBaseProductController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
         return '<a href='.('#edit-upload-option/'.$model->id).' 
44 44
          class=" btn btn-sm btn-primary " data-title="'.$model->title.'"
45 45
           data-description="'.$model->description.'" data-version="'
46
-          .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>';
46
+            .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>';
47 47
     })
48 48
     ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action'])
49 49
     ->make(true);
50 50
     }
51 51
 
52
-     //Update the File Info
52
+        //Update the File Info
53 53
     public function uploadUpdate($id, Request $request)
54 54
     {
55 55
         $file_upload = ProductUpload::find($id);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 if ($product->require_domain == 1) {
96 96
                     $field .= "<div class='col-md-4 form-group'>
97 97
                         <label class='required'>"./* @scrutinizer ignore-type */
98
-                         \Lang::get('message.domain')."</label>
98
+                            \Lang::get('message.domain')."</label>
99 99
                         <input type='text' name='domain' class='form-control' 
100 100
                         id='domain' placeholder='http://example.com'>
101 101
                 </div>";
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,28 +18,28 @@
 block discarded – undo
18 18
         ->get();
19 19
 
20 20
         return \DataTables::of($new_upload)
21
-    ->addColumn('checkbox', function ($model) {
21
+    ->addColumn('checkbox', function($model) {
22 22
         return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>';
23 23
     })
24 24
 
25
-    ->addColumn('product_id', function ($model) {
25
+    ->addColumn('product_id', function($model) {
26 26
         return ucfirst($this->product->where('id', $model->product_id)->first()->name);
27 27
     })
28 28
 
29
-    ->addColumn('title', function ($model) {
29
+    ->addColumn('title', function($model) {
30 30
         return ucfirst($model->title);
31 31
     })
32
-    ->addColumn('description', function ($model) {
32
+    ->addColumn('description', function($model) {
33 33
         return ucfirst($model->description);
34 34
     })
35
-    ->addColumn('version', function ($model) {
35
+    ->addColumn('version', function($model) {
36 36
         return $model->version;
37 37
     })
38 38
 
39
-    ->addColumn('file', function ($model) {
39
+    ->addColumn('file', function($model) {
40 40
         return $model->file;
41 41
     })
42
-    ->addColumn('action', function ($model) {
42
+    ->addColumn('action', function($model) {
43 43
         return '<a href='.('#edit-upload-option/'.$model->id).' 
44 44
          class=" btn btn-sm btn-primary " data-title="'.$model->title.'"
45 45
           data-description="'.$model->description.'" data-version="'
Please login to merge, or discard this patch.
app/Http/Controllers/Product/PlanController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
         $new_plan = Plan::select('id', 'name', 'days', 'product')->get();
59 59
 
60 60
         return\ DataTables::of($new_plan)
61
-                        ->addColumn('checkbox', function ($model) {
61
+                        ->addColumn('checkbox', function($model) {
62 62
                             return "<input type='checkbox' class='plan_checkbox' 
63 63
                             value=".$model->id.' name=select[] id=check>';
64 64
                         })
65
-                        ->addColumn('name', function ($model) {
65
+                        ->addColumn('name', function($model) {
66 66
                             return ucfirst($model->name);
67 67
                         })
68
-                        ->addColumn('days', function ($model) {
68
+                        ->addColumn('days', function($model) {
69 69
                             $months = $model->days / 30;
70 70
 
71 71
                             return round($months);
72 72
                         })
73
-                        ->addColumn('product', function ($model) {
73
+                        ->addColumn('product', function($model) {
74 74
                             $productid = $model->product;
75 75
                             $product = $this->product->where('id', $productid)->first();
76 76
                             $response = '';
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
                             return ucfirst($response);
82 82
                         })
83
-                        ->addColumn('action', function ($model) {
83
+                        ->addColumn('action', function($model) {
84 84
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
85 85
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
86 86
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.