Completed
Pull Request — development (#731)
by Ashutosh
19:03 queued 09:03
created
app/Http/Controllers/Common/SettingsController.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@
 block discarded – undo
96 96
                     $pluginName[] = $plugin->name; //get the name of active plugin
97 97
                 }
98 98
 
99
-                if (count($models) > 0) {//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned
99
+                if (count($models) > 0) {
100
+//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned
100 101
                     for ($i = 0; $i < count($pluginName); $i++) {
101 102
                         $currencies = explode(',', $models[$i]->currencies);
102 103
                         if (in_array($currency, $currencies)) {
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -302,37 +302,37 @@  discard block
 block discarded – undo
302 302
             $query = $this->advanceSearch($from, $till, $delFrom, $delTill);
303 303
 
304 304
             return \DataTables::of($query->take(50))
305
-             ->setTotalRecords($query->count())
306
-             ->addColumn('checkbox', function ($model) {
307
-                 return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>';
308
-             })
309
-                           ->addColumn('name', function ($model) {
310
-                               return ucfirst($model->log_name);
311
-                           })
312
-                             ->addColumn('description', function ($model) {
313
-                                 return ucfirst($model->description);
314
-                             })
315
-                          ->addColumn('username', function ($model) {
316
-                              $causer_id = $model->causer_id;
317
-                              $names = User::where('id', $causer_id)->pluck('last_name', 'first_name');
318
-                              foreach ($names as $key => $value) {
319
-                                  $fullName = $key.' '.$value;
320
-
321
-                                  return $fullName;
322
-                              }
323
-                          })
324
-                              ->addColumn('role', function ($model) {
325
-                                  $causer_id = $model->causer_id;
326
-                                  $role = User::where('id', $causer_id)->pluck('role');
327
-
328
-                                  return json_decode($role);
329
-                              })
330
-                               ->addColumn('new', function ($model) {
331
-                                   $properties = ($model->properties);
332
-                                   $newEntry = $this->getNewEntry($properties, $model);
333
-
334
-                                   return $newEntry;
335
-                               })
305
+                ->setTotalRecords($query->count())
306
+                ->addColumn('checkbox', function ($model) {
307
+                    return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>';
308
+                })
309
+                            ->addColumn('name', function ($model) {
310
+                                return ucfirst($model->log_name);
311
+                            })
312
+                                ->addColumn('description', function ($model) {
313
+                                    return ucfirst($model->description);
314
+                                })
315
+                            ->addColumn('username', function ($model) {
316
+                                $causer_id = $model->causer_id;
317
+                                $names = User::where('id', $causer_id)->pluck('last_name', 'first_name');
318
+                                foreach ($names as $key => $value) {
319
+                                    $fullName = $key.' '.$value;
320
+
321
+                                    return $fullName;
322
+                                }
323
+                            })
324
+                                ->addColumn('role', function ($model) {
325
+                                    $causer_id = $model->causer_id;
326
+                                    $role = User::where('id', $causer_id)->pluck('role');
327
+
328
+                                    return json_decode($role);
329
+                                })
330
+                                ->addColumn('new', function ($model) {
331
+                                    $properties = ($model->properties);
332
+                                    $newEntry = $this->getNewEntry($properties, $model);
333
+
334
+                                    return $newEntry;
335
+                                })
336 336
                                 ->addColumn('old', function ($model) {
337 337
                                     $data = ($model->properties);
338 338
                                     $oldEntry = $this->getOldEntry($data, $model);
@@ -376,42 +376,42 @@  discard block
 block discarded – undo
376 376
             $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get();
377 377
 
378 378
             return\ DataTables::of($email_log)
379
-             ->addColumn('checkbox', function ($model) {
380
-                 return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>';
381
-             })
382
-                           ->addColumn('date', function ($model) {
383
-                               $date = $model->date;
384
-                               if ($date) {
385
-                                   $date1 = new \DateTime($date);
386
-                                   $tz = \Auth::user()->timezone()->first()->name;
387
-                                   $date1->setTimezone(new \DateTimeZone($tz));
388
-                                   $finalDate = $date1->format('M j, Y, g:i a ');
389
-                               }
390
-
391
-                               return $finalDate;
392
-                           })
393
-                             ->addColumn('from', function ($model) {
394
-                                 $from = Markdown::convertToHtml($model->from);
395
-
396
-                                 return $from;
397
-                             })
398
-                              ->addColumn('to', function ($model) {
399
-                                  $to = Markdown::convertToHtml($model->to);
400
-
401
-                                  return $to;
402
-                              })
403
-
404
-                               ->addColumn('subject', function ($model) {
405
-                                   return ucfirst($model->subject);
406
-                               })
379
+                ->addColumn('checkbox', function ($model) {
380
+                    return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>';
381
+                })
382
+                            ->addColumn('date', function ($model) {
383
+                                $date = $model->date;
384
+                                if ($date) {
385
+                                    $date1 = new \DateTime($date);
386
+                                    $tz = \Auth::user()->timezone()->first()->name;
387
+                                    $date1->setTimezone(new \DateTimeZone($tz));
388
+                                    $finalDate = $date1->format('M j, Y, g:i a ');
389
+                                }
390
+
391
+                                return $finalDate;
392
+                            })
393
+                                ->addColumn('from', function ($model) {
394
+                                    $from = Markdown::convertToHtml($model->from);
395
+
396
+                                    return $from;
397
+                                })
398
+                                ->addColumn('to', function ($model) {
399
+                                    $to = Markdown::convertToHtml($model->to);
400
+
401
+                                    return $to;
402
+                                })
403
+
404
+                                ->addColumn('subject', function ($model) {
405
+                                    return ucfirst($model->subject);
406
+                                })
407 407
                                 // ->addColumn('headers', function ($model) {
408 408
                                 //     $headers = Markdown::convertToHtml(ucfirst($model->headers));
409 409
 
410 410
                                 //     return $headers;
411 411
                                 // })
412
-                              ->addColumn('status', function ($model) {
413
-                                  return ucfirst($model->status);
414
-                              })
412
+                                ->addColumn('status', function ($model) {
413
+                                    return ucfirst($model->status);
414
+                                })
415 415
 
416 416
                             ->rawColumns(['checkbox', 'date', 'from', 'to',
417 417
                                 'bcc', 'subject',  'status', ])
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $mobileauthkey = $apikeys->pluck('msg91_auth_key')->first();
69 69
             $updateUrl = $apikeys->pluck('update_api_url')->first();
70 70
             $emailStatus = StatusSetting::pluck('emailverification_status')->first();
71
-            $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret',
71
+            $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret',
72 72
                 'twitter_access_token', 'access_tooken_secret')->first();
73 73
             $twitterStatus = $this->statusSetting->pluck('twitter_status')->first();
74 74
             $zohoStatus = $this->statusSetting->pluck('zoho_status')->first();
@@ -303,16 +303,16 @@  discard block
 block discarded – undo
303 303
 
304 304
             return \DataTables::of($query->take(50))
305 305
              ->setTotalRecords($query->count())
306
-             ->addColumn('checkbox', function ($model) {
306
+             ->addColumn('checkbox', function($model) {
307 307
                  return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>';
308 308
              })
309
-                           ->addColumn('name', function ($model) {
309
+                           ->addColumn('name', function($model) {
310 310
                                return ucfirst($model->log_name);
311 311
                            })
312
-                             ->addColumn('description', function ($model) {
312
+                             ->addColumn('description', function($model) {
313 313
                                  return ucfirst($model->description);
314 314
                              })
315
-                          ->addColumn('username', function ($model) {
315
+                          ->addColumn('username', function($model) {
316 316
                               $causer_id = $model->causer_id;
317 317
                               $names = User::where('id', $causer_id)->pluck('last_name', 'first_name');
318 318
                               foreach ($names as $key => $value) {
@@ -321,41 +321,41 @@  discard block
 block discarded – undo
321 321
                                   return $fullName;
322 322
                               }
323 323
                           })
324
-                              ->addColumn('role', function ($model) {
324
+                              ->addColumn('role', function($model) {
325 325
                                   $causer_id = $model->causer_id;
326 326
                                   $role = User::where('id', $causer_id)->pluck('role');
327 327
 
328 328
                                   return json_decode($role);
329 329
                               })
330
-                               ->addColumn('new', function ($model) {
330
+                               ->addColumn('new', function($model) {
331 331
                                    $properties = ($model->properties);
332 332
                                    $newEntry = $this->getNewEntry($properties, $model);
333 333
 
334 334
                                    return $newEntry;
335 335
                                })
336
-                                ->addColumn('old', function ($model) {
336
+                                ->addColumn('old', function($model) {
337 337
                                     $data = ($model->properties);
338 338
                                     $oldEntry = $this->getOldEntry($data, $model);
339 339
 
340 340
                                     return $oldEntry;
341 341
                                 })
342
-                                ->addColumn('created_at', function ($model) {
342
+                                ->addColumn('created_at', function($model) {
343 343
                                     $newDate = $this->getDate($model->created_at);
344 344
 
345 345
                                     return $newDate;
346 346
                                 })
347 347
 
348
-                                    ->filterColumn('log_name', function ($query, $keyword) {
348
+                                    ->filterColumn('log_name', function($query, $keyword) {
349 349
                                         $sql = 'log_name like ?';
350 350
                                         $query->whereRaw($sql, ["%{$keyword}%"]);
351 351
                                     })
352 352
 
353
-                                ->filterColumn('description', function ($query, $keyword) {
353
+                                ->filterColumn('description', function($query, $keyword) {
354 354
                                     $sql = 'description like ?';
355 355
                                     $query->whereRaw($sql, ["%{$keyword}%"]);
356 356
                                 })
357 357
 
358
-                            ->filterColumn('causer_id', function ($query, $keyword) {
358
+                            ->filterColumn('causer_id', function($query, $keyword) {
359 359
                                 $sql = 'first_name like ?';
360 360
                                 $query->whereRaw($sql, ["%{$keyword}%"]);
361 361
                             })
@@ -376,10 +376,10 @@  discard block
 block discarded – undo
376 376
             $email_log = \DB::table('email_log')->orderBy('date', 'desc')->get();
377 377
 
378 378
             return\ DataTables::of($email_log)
379
-             ->addColumn('checkbox', function ($model) {
379
+             ->addColumn('checkbox', function($model) {
380 380
                  return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>';
381 381
              })
382
-                           ->addColumn('date', function ($model) {
382
+                           ->addColumn('date', function($model) {
383 383
                                $date = $model->date;
384 384
                                if ($date) {
385 385
                                    $date1 = new \DateTime($date);
@@ -390,18 +390,18 @@  discard block
 block discarded – undo
390 390
 
391 391
                                return $finalDate;
392 392
                            })
393
-                             ->addColumn('from', function ($model) {
393
+                             ->addColumn('from', function($model) {
394 394
                                  $from = Markdown::convertToHtml($model->from);
395 395
 
396 396
                                  return $from;
397 397
                              })
398
-                              ->addColumn('to', function ($model) {
398
+                              ->addColumn('to', function($model) {
399 399
                                   $to = Markdown::convertToHtml($model->to);
400 400
 
401 401
                                   return $to;
402 402
                               })
403 403
 
404
-                               ->addColumn('subject', function ($model) {
404
+                               ->addColumn('subject', function($model) {
405 405
                                    return ucfirst($model->subject);
406 406
                                })
407 407
                                 // ->addColumn('headers', function ($model) {
@@ -409,12 +409,12 @@  discard block
 block discarded – undo
409 409
 
410 410
                                 //     return $headers;
411 411
                                 // })
412
-                              ->addColumn('status', function ($model) {
412
+                              ->addColumn('status', function($model) {
413 413
                                   return ucfirst($model->status);
414 414
                               })
415 415
 
416 416
                             ->rawColumns(['checkbox', 'date', 'from', 'to',
417
-                                'bcc', 'subject',  'status', ])
417
+                                'bcc', 'subject', 'status', ])
418 418
                             ->make(true);
419 419
         } catch (\Exception $e) {
420 420
             Bugsnag::notifyException($e);
Please login to merge, or discard this patch.
app/Http/Controllers/Product/PlanController.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -87,22 +87,22 @@  discard block
 block discarded – undo
87 87
 
88 88
                             return ucfirst($response);
89 89
                         })
90
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
91
-                             $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
90
+                            ->addColumn('price', function ($model) use ($defaultCurrency) {
91
+                                $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
92 92
                             ->pluck('add_price')->first();
93
-                             if ($price != null) {
94
-                                 return $price;
95
-                             } else {
96
-                                 return 'Not Available';
97
-                             }
98
-                         })
99
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
100
-                             if ($defaultCurrency && $defaultCurrency != null) {
101
-                                 return $defaultCurrency;
102
-                             } else {
103
-                                 return 'Not Available';
104
-                             }
105
-                         })
93
+                                if ($price != null) {
94
+                                    return $price;
95
+                                } else {
96
+                                    return 'Not Available';
97
+                                }
98
+                            })
99
+                            ->addColumn('currency', function ($model) use ($defaultCurrency) {
100
+                                if ($defaultCurrency && $defaultCurrency != null) {
101
+                                    return $defaultCurrency;
102
+                                } else {
103
+                                    return 'Not Available';
104
+                                }
105
+                            })
106 106
                         ->addColumn('action', function ($model) {
107 107
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
108 108
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
         $agentQuantity = $plan->planPrice->first()->no_of_agents;
207 207
         foreach ($products as $key => $product) {
208 208
             $selectedProduct = $this->product->where('id', $plan->product)
209
-          ->pluck('name', 'id', 'subscription')->toArray();
209
+            ->pluck('name', 'id', 'subscription')->toArray();
210 210
         }
211 211
         $selectedPeriods = $this->period->where('days', $plan->days)
212
-       ->pluck('name', 'days')->toArray();
212
+        ->pluck('name', 'days')->toArray();
213 213
 
214 214
         return view(
215 215
             'themes.default1.product.plan.edit',
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
             'name'                => 'required',
248 248
             'add_price.*'         => 'required',
249 249
             'product'             => 'required',
250
-              'days'              => $days_rule.'numeric',
251
-               'product_quantity' => 'required_without:no_of_agents|integer|min:0',
250
+                'days'              => $days_rule.'numeric',
251
+                'product_quantity' => 'required_without:no_of_agents|integer|min:0',
252 252
             'no_of_agents'        => 'required_without:product_quantity|integer|min:0',
253 253
         ]);
254 254
         $product_quantity = $request->input('product_quantity');
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
         $defaultCurrency = Setting::where('id', 1)->value('default_currency');
62 62
 
63 63
         return\ DataTables::of($new_plan)
64
-                        ->addColumn('checkbox', function ($model) {
64
+                        ->addColumn('checkbox', function($model) {
65 65
                             return "<input type='checkbox' class='plan_checkbox' 
66 66
                             value=".$model->id.' name=select[] id=check>';
67 67
                         })
68
-                        ->addColumn('name', function ($model) {
68
+                        ->addColumn('name', function($model) {
69 69
                             return ucfirst($model->name);
70 70
                         })
71
-                        ->addColumn('days', function ($model) {
71
+                        ->addColumn('days', function($model) {
72 72
                             if ($model->days != '') {
73 73
                                 $months = $model->days / 30;
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
                             return 'Not Available';
79 79
                         })
80
-                        ->addColumn('product', function ($model) {
80
+                        ->addColumn('product', function($model) {
81 81
                             $productid = $model->product;
82 82
                             $product = $this->product->where('id', $productid)->first();
83 83
                             $response = '';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
                             return ucfirst($response);
89 89
                         })
90
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
90
+                         ->addColumn('price', function($model) use ($defaultCurrency) {
91 91
                              $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
92 92
                             ->pluck('add_price')->first();
93 93
                              if ($price != null) {
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
                                  return 'Not Available';
97 97
                              }
98 98
                          })
99
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
99
+                         ->addColumn('currency', function($model) use ($defaultCurrency) {
100 100
                              if ($defaultCurrency && $defaultCurrency != null) {
101 101
                                  return $defaultCurrency;
102 102
                              } else {
103 103
                                  return 'Not Available';
104 104
                              }
105 105
                          })
106
-                        ->addColumn('action', function ($model) {
106
+                        ->addColumn('action', function($model) {
107 107
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
108 108
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
109 109
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CheckoutController.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                 $ends_at = '';
405 405
             }
406 406
             $this->subscription->create(['user_id' => \Auth::user()->id,
407
-             'plan_id'                             => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, ]);
407
+                'plan_id'                             => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, ]);
408 408
         } catch (\Exception $ex) {
409 409
             app('log')->error($ex->getMessage());
410 410
             Bugsnag::notifyException($ex);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             $invoiceItem = $this->invoiceItem->create(['invoice_id' => $invoiceid,
456 456
                 'product_name'                                      => $product_name, 'regular_price' => $regular_price,
457 457
                 'quantity'                                          => $quantity, 'tax_name' => $tax_name,
458
-                 'tax_percentage'                                   => $tax_percentage, 'subtotal' => $subtotal, ]);
458
+                    'tax_percentage'                                   => $tax_percentage, 'subtotal' => $subtotal, ]);
459 459
         } catch (\Exception $ex) {
460 460
             app('log')->error($ex->getMessage());
461 461
             Bugsnag::notifyException($ex);
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,8 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function checkoutForm(Request $request)
82 82
     {
83
-        if (!\Auth::user()) {//If User is not Logged in then send him to login Page
83
+        if (!\Auth::user()) {
84
+//If User is not Logged in then send him to login Page
84 85
             $url = $request->segments(); //The requested url (chekout).Save it in Session
85 86
             \Session::put('session-url', $url[0]);
86 87
             $content = Cart::getContent();
@@ -106,7 +107,8 @@  discard block
 block discarded – undo
106 107
 
107 108
         try {
108 109
             $domain = $request->input('domain');
109
-            if ($domain) {//Store the Domain  in session when user Logged In
110
+            if ($domain) {
111
+//Store the Domain  in session when user Logged In
110 112
                 foreach ($domain as $key => $value) {
111 113
                     \Session::put('domain'.$key, $value);
112 114
                 }
@@ -131,7 +133,8 @@  discard block
 block discarded – undo
131 133
     public function getAttributes($content)
132 134
     {
133 135
         try {
134
-            if (count($content) > 0) {//after ProductPurchase this is not true as cart is cleared
136
+            if (count($content) > 0) {
137
+//after ProductPurchase this is not true as cart is cleared
135 138
                 foreach ($content as $key => $item) {
136 139
                     $attributes[] = $item->attributes;
137 140
                     $cart_currency = $attributes[0]['currency']['currency']; //Get the currency of Product in the cart
Please login to merge, or discard this patch.
app/Http/Controllers/Front/BaseCartController.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
         $currency = $request->input('currency');
193 193
         $symbol = $request->input('symbol');
194 194
         Cart::update($id, [
195
-             'price'    => $price,
196
-           'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]],
195
+                'price'    => $price,
196
+            'attributes' => ['agents' => $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]],
197 197
         ]);
198 198
 
199 199
         return 'success';
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
         $currency = $request->input('currency');
215 215
         $symbol = $request->input('symbol');
216 216
         Cart::update($id, [
217
-           'price'      => $price,
218
-           'attributes' => ['agents' =>  $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]],
217
+            'price'      => $price,
218
+            'attributes' => ['agents' =>  $agtqty, 'currency'=>['currency'=>$currency, 'symbol'=>$symbol]],
219 219
         ]);
220 220
 
221 221
         return 'success';
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 'relative' => false,
259 259
                 'value'    => $qty,
260 260
             ],
261
-           'price'  => $price,
261
+            'price'  => $price,
262 262
         ]);
263 263
 
264 264
         return 'success';
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             $actualPrice = $this->cost($product->id);
296 296
             // $taxConditions = $this->checkTax($id);
297 297
             $items = ['id'     => $id, 'name' => $product->name, 'price' => $actualPrice,
298
-                 'quantity'    => $qty, 'attributes' => ['currency' => $currency, 'agents'=> $agents], ];
298
+                    'quantity'    => $qty, 'attributes' => ['currency' => $currency, 'agents'=> $agents], ];
299 299
 
300 300
             return $items;
301 301
         } catch (\Exception $e) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -283,7 +283,8 @@
 block discarded – undo
283 283
             $planid = $this->checkPlanSession() === true ? Session::get('plan') : Plan::where('product', $id)->pluck('id')->first(); //Get Plan id From Session
284 284
             $product = Product::find($id);
285 285
             $plan = $product->planRelation->find($planid);
286
-            if ($plan) { //If Plan For a Product exists
286
+            if ($plan) {
287
+//If Plan For a Product exists
287 288
                 $quantity = $plan->planPrice->first()->product_quantity;
288 289
                 //If Product quantity is null(when show agent in Product Seting Selected),then set quantity as 1;
289 290
                 $qty = $quantity != null ? $quantity : 1;
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,11 +177,13 @@
 block discarded – undo
177 177
 
178 178
                                 //if product has Update expiry date ie subscription is generated
179 179
                                 if ($updateEndDate) {
180
-                                    if ($downloadPermission['allowDownloadTillExpiry'] == 1) {//Perpetual download till expiry permission selected
180
+                                    if ($downloadPermission['allowDownloadTillExpiry'] == 1) {
181
+//Perpetual download till expiry permission selected
181 182
                                         $getDownload = $this->whenDownloadTillExpiry($updateEndDate, $productid, $versions, $clientid, $invoiceid);
182 183
 
183 184
                                         return $getDownload;
184
-                                    } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) {//When download retires after subscription
185
+                                    } elseif ($downloadPermission['allowDownloadTillExpiry'] == 0) {
186
+//When download retires after subscription
185 187
                                         $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $updateEndDate, $productid, $versions, $clientid, $invoiceid);
186 188
 
187 189
                                         return $getDownload;
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
             $order_id = $order->id;
146 146
             $updatesEndDate = Subscription::select('update_ends_at')
147
-                 ->where('product_id', $productid)->where('order_id', $order_id)->first();
147
+                    ->where('product_id', $productid)->where('order_id', $order_id)->first();
148 148
             if ($updatesEndDate) {
149 149
                 foreach ($versions as $version) {
150 150
                     if ($version->created_at->toDateTimeString()
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
                             ->addColumn('payment_method', function ($model) {
418 418
                                 return $model->payment_method;
419 419
                             })
420
-                             ->addColumn('payment_status', function ($model) {
421
-                                 return $model->payment_status;
422
-                             })
420
+                                ->addColumn('payment_status', function ($model) {
421
+                                    return $model->payment_status;
422
+                                })
423 423
                             ->addColumn('created_at', function ($model) {
424 424
                                 $date1 = new DateTime($model->created_at);
425 425
                                 $tz = \Auth::user()->timezone()->first()->name;
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
                                 return $date;
430 430
                             })
431 431
                             ->rawColumns(['checkbox', 'number', 'amount',
432
-                             'payment_method', 'payment_status', 'created_at', ])
432
+                                'payment_method', 'payment_status', 'created_at', ])
433 433
                             ->make(true);
434 434
         } catch (Exception $ex) {
435 435
             Bugsnag::notifyException($ex);
@@ -455,17 +455,17 @@  discard block
 block discarded – undo
455 455
                             ->addColumn('number', function ($model) {
456 456
                                 return $model->invoice()->first()->number;
457 457
                             })
458
-                              ->addColumn('total', function ($model) {
459
-                                  return $model->amount;
460
-                              })
461
-                               ->addColumn('created_at', function ($model) {
462
-                                   $date1 = new DateTime($model->created_at);
463
-                                   $tz = \Auth::user()->timezone()->first()->name;
464
-                                   $date1->setTimezone(new DateTimeZone($tz));
465
-                                   $date = $date1->format('M j, Y, g:i a');
466
-
467
-                                   return $date;
468
-                               })
458
+                                ->addColumn('total', function ($model) {
459
+                                    return $model->amount;
460
+                                })
461
+                                ->addColumn('created_at', function ($model) {
462
+                                    $date1 = new DateTime($model->created_at);
463
+                                    $tz = \Auth::user()->timezone()->first()->name;
464
+                                    $date1->setTimezone(new DateTimeZone($tz));
465
+                                    $date = $date1->format('M j, Y, g:i a');
466
+
467
+                                    return $date;
468
+                                })
469 469
 
470 470
                             ->addColumn('payment_method', 'payment_status', 'created_at')
471 471
 
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
                     ->select('number', 'created_at', 'grand_total', 'id', 'status');
80 80
 
81 81
             return \DataTables::of($invoices->get())
82
-                            ->addColumn('number', function ($model) {
82
+                            ->addColumn('number', function($model) {
83 83
                                 return $model->number;
84 84
                             })
85
-                            ->addColumn('date', function ($model) {
85
+                            ->addColumn('date', function($model) {
86 86
                                 $date = $model->created_at;
87 87
 
88 88
                                 return $date;
89 89
                             })
90
-                            ->addColumn('total', function ($model) {
90
+                            ->addColumn('total', function($model) {
91 91
                                 return  currency_format($model->grand_total, $code = \Auth::user()->currency);
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) {
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
             }
156 156
 
157 157
             return \DataTables::of($versions)
158
-                            ->addColumn('id', function ($versions) {
158
+                            ->addColumn('id', function($versions) {
159 159
                                 return ucfirst($versions->id);
160 160
                             })
161
-                            ->addColumn('version', function ($versions) {
161
+                            ->addColumn('version', function($versions) {
162 162
                                 return ucfirst($versions->version);
163 163
                             })
164
-                            ->addColumn('title', function ($versions) {
164
+                            ->addColumn('title', function($versions) {
165 165
                                 return ucfirst($versions->title);
166 166
                             })
167
-                            ->addColumn('description', function ($versions) {
167
+                            ->addColumn('description', function($versions) {
168 168
                                 return ucfirst($versions->description);
169 169
                             })
170
-                            ->addColumn('file', function ($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) {
170
+                            ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) {
171 171
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
172 172
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
173 173
                                 $order_id = $order->id;
@@ -233,18 +233,18 @@  discard block
 block discarded – undo
233 233
             }
234 234
 
235 235
             return \DataTables::of($link)
236
-                            ->addColumn('version', function ($link) {
236
+                            ->addColumn('version', function($link) {
237 237
                                 return ucfirst($link['tag_name']);
238 238
                             })
239
-                            ->addColumn('name', function ($link) {
239
+                            ->addColumn('name', function($link) {
240 240
                                 return ucfirst($link['name']);
241 241
                             })
242
-                            ->addColumn('description', function ($link) {
242
+                            ->addColumn('description', function($link) {
243 243
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
244 244
 
245 245
                                 return $markdown;
246 246
                             })
247
-                            ->addColumn('file', function ($link) use ($countExpiry, $countVersions, $invoiceid, $productid) {
247
+                            ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) {
248 248
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
249 249
                                 $order_id = $order->id;
250 250
                                 $orderEndDate = Subscription::select('update_ends_at')
@@ -280,20 +280,20 @@  discard block
 block discarded – undo
280 280
             $orders = Order::where('client', \Auth::user()->id);
281 281
 
282 282
             return \DataTables::of($orders->get())
283
-                            ->addColumn('id', function ($model) {
283
+                            ->addColumn('id', function($model) {
284 284
                                 return $model->id;
285 285
                             })
286
-                            ->addColumn('product_name', function ($model) {
286
+                            ->addColumn('product_name', function($model) {
287 287
                                 return $model->product()->first()->name;
288 288
                             })
289
-                            ->addColumn('expiry', function ($model) {
289
+                            ->addColumn('expiry', function($model) {
290 290
                                 $tz = \Auth::user()->timezone()->first()->name;
291 291
                                 $end = $this->getExpiryDate($model);
292 292
 
293 293
                                 return $end;
294 294
                             })
295 295
 
296
-                            ->addColumn('Action', function ($model) {
296
+                            ->addColumn('Action', function($model) {
297 297
                                 $sub = $model->subscription()->first();
298 298
                                 $order = Order::where('id', $model->id)->select('product')->first();
299 299
                                 $productid = $order->product;
@@ -399,28 +399,28 @@  discard block
 block discarded – undo
399 399
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
400 400
 
401 401
             return \DataTables::of($payments->get())
402
-                            ->addColumn('checkbox', function ($model) {
402
+                            ->addColumn('checkbox', function($model) {
403 403
                                 if (\Input::get('client') != 'true') {
404 404
                                     return "<input type='checkbox' class='payment_checkbox' 
405 405
                                     value=".$model->id.' name=select[] id=check>';
406 406
                                 }
407 407
                             })
408
-                            ->addColumn('number', function ($model) {
408
+                            ->addColumn('number', function($model) {
409 409
                                 return $model->invoice()->first()->number;
410 410
                             })
411
-                            ->addColumn('amount', function ($model) {
411
+                            ->addColumn('amount', function($model) {
412 412
                                 $currency = $model->invoice()->first()->currency;
413 413
                                 $total = currency_format($model->amount, $code = $currency);
414 414
 
415 415
                                 return $total;
416 416
                             })
417
-                            ->addColumn('payment_method', function ($model) {
417
+                            ->addColumn('payment_method', function($model) {
418 418
                                 return $model->payment_method;
419 419
                             })
420
-                             ->addColumn('payment_status', function ($model) {
420
+                             ->addColumn('payment_status', function($model) {
421 421
                                  return $model->payment_status;
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));
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
453 453
             //dd(\Input::all());
454 454
             return \DataTables::of($payments->get())
455
-                            ->addColumn('number', function ($model) {
455
+                            ->addColumn('number', function($model) {
456 456
                                 return $model->invoice()->first()->number;
457 457
                             })
458
-                              ->addColumn('total', function ($model) {
458
+                              ->addColumn('total', function($model) {
459 459
                                   return $model->amount;
460 460
                               })
461
-                               ->addColumn('created_at', function ($model) {
461
+                               ->addColumn('created_at', function($model) {
462 462
                                    $date1 = new DateTime($model->created_at);
463 463
                                    $tz = \Auth::user()->timezone()->first()->name;
464 464
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
app/Http/Controllers/License/LicensePermissionsController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,20 +44,20 @@  discard block
 block discarded – undo
44 44
             $licenseType = LicenseType::select('id', 'name')->get();
45 45
 
46 46
             return \DataTables::of($licenseType)
47
-            ->addColumn('checkbox', function ($model) {
47
+            ->addColumn('checkbox', function($model) {
48 48
                 return "<input type='checkbox' class='type_checkbox' 
49 49
             value=".$model->id.' name=select[] id=check>';
50 50
             })
51
-            ->addColumn('license_type', function ($model) {
51
+            ->addColumn('license_type', function($model) {
52 52
                 return ucfirst($model->name);
53 53
             })
54
-            ->addColumn('permissions', function ($model) {
54
+            ->addColumn('permissions', function($model) {
55 55
                 $permissions = $model->permissions->pluck('permissions');
56 56
                 $allPermissions = $this->showPermissions($permissions);
57 57
 
58 58
                 return $allPermissions;
59 59
             })
60
-            ->addColumn('action', function ($model) {
60
+            ->addColumn('action', function($model) {
61 61
                 $selectedPermission = $model->permissions->pluck('id');
62 62
 
63 63
                 return "<p><button data-toggle='modal' 
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
                     $downloadPermission = 1; //Has Permission for Download
168 168
                 }
169 169
                 if ($permission == 'No Permissions') {
170
-                    $noPermissions = 1;  //Has No Permission
170
+                    $noPermissions = 1; //Has No Permission
171 171
                 }
172 172
                 if ($permission == 'Allow Downloads Before Updates Expire') {
173
-                    $allowDownloadTillExpiry = 1;  //allow download after Expiry
173
+                    $allowDownloadTillExpiry = 1; //allow download after Expiry
174 174
                 }
175 175
             }
176 176
 
Please login to merge, or discard this patch.
app/Http/Controllers/License/LicenseSettingsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
             $allTypes = $this->licenseType->select('id', 'name')->get();
39 39
 
40 40
             return \DataTables::of($allTypes)
41
-            ->addColumn('checkbox', function ($model) {
41
+            ->addColumn('checkbox', function($model) {
42 42
                 return "<input type='checkbox' class='type_checkbox' 
43 43
             value=".$model->id.' name=select[] id=check>';
44 44
             })
45
-            ->addColumn('type_name', function ($model) {
45
+            ->addColumn('type_name', function($model) {
46 46
                 return ucfirst($model->name);
47 47
             })
48
-            ->addColumn('action', function ($model) {
48
+            ->addColumn('action', function($model) {
49 49
                 return "<p><button data-toggle='modal' 
50 50
              data-id=".$model->id." data-name= '$model->name' 
51 51
              class='btn btn-sm btn-primary btn-xs editType'><i class='fa fa-edit'
Please login to merge, or discard this patch.
app/Http/Controllers/License/LicenseController.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,8 @@  discard block
 block discarded – undo
84 84
             $getProductId = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=search
85 85
             &search_type=product&search_keyword=$product_sku");
86 86
             $details = json_decode($getProductId);
87
-            if ($details->api_error_detected == 0 && is_array($details->page_message)) {//This is not true if Product_sku is updated
87
+            if ($details->api_error_detected == 0 && is_array($details->page_message)) {
88
+//This is not true if Product_sku is updated
88 89
                 $productId = $details->page_message[0]->product_id;
89 90
             }
90 91
 
@@ -120,7 +121,8 @@  discard block
 block discarded – undo
120 121
       &search_type=client&search_keyword=$email");
121 122
 
122 123
         $details = json_decode($getUserId);
123
-        if ($details->api_error_detected == 0 && is_array($details->page_message)) {//This is not true if email is updated
124
+        if ($details->api_error_detected == 0 && is_array($details->page_message)) {
125
+//This is not true if email is updated
124 126
             $userId = $details->page_message[0]->client_id;
125 127
         }
126 128
 
Please login to merge, or discard this patch.
app/Http/Middleware/Admin.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,8 @@
 block discarded – undo
47 47
             if ($url) {
48 48
                 $content = \Cart::getContent();
49 49
                 $currency = (\Session::get('currency'));
50
-                if (\Auth::user()->currency != $currency['currency']) {//If user currency is not equal to the cart currency then redirect to default url and clear his cart items and let the customer add the Product again so that the tax could be calculated properly
50
+                if (\Auth::user()->currency != $currency['currency']) {
51
+//If user currency is not equal to the cart currency then redirect to default url and clear his cart items and let the customer add the Product again so that the tax could be calculated properly
51 52
                     foreach ($content as $key => $item) {
52 53
                         $id = $item->id;
53 54
                         Cart::remove($id);
Please login to merge, or discard this patch.