Test Setup Failed
Branch development (80c362)
by Ashutosh
14:59
created
app/Model/Product/Product.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     use LogsActivity;
11 11
     protected $table = 'products';
12 12
     protected $fillable = ['name', 'description', 'type', 'group', 'file', 'image', 'require_domain', 'category',
13
-        'can_modify_agent',  'can_modify_quantity', 'show_agent', 'tax_apply', 'show_product_quantity', 'hidden',  'auto_terminate',
13
+        'can_modify_agent', 'can_modify_quantity', 'show_agent', 'tax_apply', 'show_product_quantity', 'hidden', 'auto_terminate',
14 14
         'setup_order_placed', 'setup_first_payment', 'setup_accept_manually',
15 15
         'no_auto_setup', 'shoping_cart_link', 'process_url', 'github_owner',
16 16
         'github_repository',
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     protected static $logName = 'Product';
20 20
 
21 21
     protected static $logAttributes = ['name', 'description', 'type', 'file', 'category',
22
-        'github_owner', 'github_repository', 'version',  'subscription', 'hidden', 'product_sku', ];
22
+        'github_owner', 'github_repository', 'version', 'subscription', 'hidden', 'product_sku', ];
23 23
 
24 24
     protected static $logOnlyDirty = true;
25 25
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     public function getImageAttribute($value)
90 90
     {
91
-        if (! $value) {
91
+        if (!$value) {
92 92
             $image = asset('common/images/No-image-found.jpg');
93 93
         } else {
94 94
             $image = asset("common/images/$value");
Please login to merge, or discard this patch.
app/Model/Product/Subscription.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         'user_id', 'plan_id', 'order_id', 'deny_after_subscription', 'version', 'product_id', 'support_ends_at', ];
16 16
     protected $dates = ['ends_at'];
17 17
     protected static $logName = 'Subscription';
18
-    protected static $logAttributes = ['ends_at', 'update_ends_at', 'support_ends_at', 'user_id', 'plan_id', 'order_id',  'version', 'product_id'];
18
+    protected static $logAttributes = ['ends_at', 'update_ends_at', 'support_ends_at', 'user_id', 'plan_id', 'order_id', 'version', 'product_id'];
19 19
     protected static $logOnlyDirty = true;
20 20
 
21 21
     public function getDescriptionForEvent(string $eventName): string
Please login to merge, or discard this patch.
app/Model/Order/InvoiceItem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
24 24
             return $regs['domain'];
25 25
         }
26
-        if (! $domain) {
26
+        if (!$domain) {
27 27
             $domain = $pieces['path'];
28 28
         }
29 29
 
Please login to merge, or discard this patch.
app/Model/Order/Order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
         if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
137 137
             return $regs['domain'];
138 138
         }
139
-        if (! $domain) {
139
+        if (!$domain) {
140 140
             $domain = $pieces['path'];
141 141
         }
142 142
 
Please login to merge, or discard this patch.
app/Providers/HorizonServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     protected function gate()
35 35
     {
36
-        Gate::define('viewHorizon', function ($user) {
36
+        Gate::define('viewHorizon', function($user) {
37 37
             return in_array($user->email, [
38 38
                 $user->email,
39 39
             ]);
Please login to merge, or discard this patch.
app/Http/Middleware/SecurityEnforcer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function handle($request, Closure $next)
23 23
     {
24
-        if (! config('database.DB_INSTALL')) {
24
+        if (!config('database.DB_INSTALL')) {
25 25
             return $next($request);
26 26
         }
27 27
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $parsedUrl = parse_url($url);
53 53
 
54
-        if (! $parsedUrl) {
54
+        if (!$parsedUrl) {
55 55
             return '';
56 56
         }
57 57
 
Please login to merge, or discard this patch.
app/Http/Middleware/IsInstalled.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     public function handle($request, Closure $next)
18 18
     {
19 19
         $env = base_path('.env');
20
-        if (! $this->alreadyInstalled()) {
20
+        if (!$this->alreadyInstalled()) {
21 21
             return $next($request);
22 22
         } else {
23 23
             if ($request->isJson()) {
Please login to merge, or discard this patch.
app/Http/Controllers/License/LicenseSettingsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 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-secondary btn-xs editType'".tooltip('Edit')."<i class='fa fa-edit'
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         try {
105 105
             $ids = $request->input('select');
106
-            if (! empty($ids)) {
106
+            if (!empty($ids)) {
107 107
                 foreach ($ids as $id) {
108 108
                     $type = $this->licenseType->where('id', $id)->first();
109 109
                     if ($type) {
Please login to merge, or discard this patch.
app/Http/Controllers/User/AdminOrderInvoiceController.php 3 patches
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -34,48 +34,48 @@  discard block
 block discarded – undo
34 34
 
35 35
                             return $label;
36 36
                         })
37
-                         ->addColumn('order_no', function ($model) {
38
-                             if ($model->is_renewed) {
39
-                                 return Order::find($model->order_id)->first()->getOrderLink($model->order_id, 'orders');
40
-                             } else {
41
-                                 $allOrders = ($model->order()->select('id', 'number')->get());
42
-                                 $orderArray = '';
43
-                                 foreach ($allOrders as $orders) {
44
-                                     $orderArray .= $orders->getOrderLink($orders->id, 'orders');
45
-                                 }
46
-
47
-                                 return $orderArray;
48
-                             }
49
-                         })
37
+                            ->addColumn('order_no', function ($model) {
38
+                                if ($model->is_renewed) {
39
+                                    return Order::find($model->order_id)->first()->getOrderLink($model->order_id, 'orders');
40
+                                } else {
41
+                                    $allOrders = ($model->order()->select('id', 'number')->get());
42
+                                    $orderArray = '';
43
+                                    foreach ($allOrders as $orders) {
44
+                                        $orderArray .= $orders->getOrderLink($orders->id, 'orders');
45
+                                    }
46
+
47
+                                    return $orderArray;
48
+                                }
49
+                            })
50 50
                         ->addColumn('total', function ($model) use ($client) {
51 51
                             return currencyFormat($model->grand_total, $code = $client->currency);
52 52
                         })
53
-                         ->addColumn('paid', function ($model) use ($client) {
54
-                             $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
55
-                             $c = count($payment);
56
-                             $sum = 0;
57
-
58
-                             for ($i = 0; $i <= $c - 1; $i++) {
59
-                                 $sum = $sum + $payment[$i]->amount;
60
-                             }
61
-
62
-                             return currencyFormat($sum, $code = $client->currency);
63
-                         })
64
-                         ->addColumn('balance', function ($model) use ($client) {
65
-                             $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
66
-                             $c = count($payment);
67
-                             $sum = 0;
68
-
69
-                             for ($i = 0; $i <= $c - 1; $i++) {
70
-                                 $sum = $sum + $payment[$i]->amount;
71
-                             }
72
-                             $pendingAmount = ($model->grand_total) - ($sum);
73
-
74
-                             return currencyFormat($pendingAmount, $code = $client->currency);
75
-                         })
76
-                          ->addColumn('status', function ($model) {
77
-                              return getStatusLabel($model->status);
78
-                          })
53
+                            ->addColumn('paid', function ($model) use ($client) {
54
+                                $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
55
+                                $c = count($payment);
56
+                                $sum = 0;
57
+
58
+                                for ($i = 0; $i <= $c - 1; $i++) {
59
+                                    $sum = $sum + $payment[$i]->amount;
60
+                                }
61
+
62
+                                return currencyFormat($sum, $code = $client->currency);
63
+                            })
64
+                            ->addColumn('balance', function ($model) use ($client) {
65
+                                $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
66
+                                $c = count($payment);
67
+                                $sum = 0;
68
+
69
+                                for ($i = 0; $i <= $c - 1; $i++) {
70
+                                    $sum = $sum + $payment[$i]->amount;
71
+                                }
72
+                                $pendingAmount = ($model->grand_total) - ($sum);
73
+
74
+                                return currencyFormat($pendingAmount, $code = $client->currency);
75
+                            })
76
+                            ->addColumn('status', function ($model) {
77
+                                return getStatusLabel($model->status);
78
+                            })
79 79
                         ->addColumn('action', function ($model) {
80 80
                             $action = '';
81 81
                             $cont = new \App\Http\Controllers\Order\TaxRatesAndCodeExpiryController();
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                             style='color:white;'></i></a>"
95 95
                                     ."   $editAction $action";
96 96
                         })
97
-                         ->rawColumns(['checkbox', 'date', 'invoice_no', 'order_no', 'total', 'paid', 'balance', 'status', 'action'])
97
+                            ->rawColumns(['checkbox', 'date', 'invoice_no', 'order_no', 'total', 'paid', 'balance', 'status', 'action'])
98 98
                         ->make(true);
99 99
     }
100 100
 
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
 
131 131
                             return $orderLink;
132 132
                         })
133
-                         ->addColumn('version', function ($model) {
134
-                             return getVersionAndLabel($model->product_version, $model->product);
135
-                         })
136
-                          ->addColumn('expiry', function ($model) {
137
-                              $ends_at = strtotime($model->subscription_ends_at) > 1 ? $model->subscription_ends_at : '--';
138
-
139
-                              return getExpiryLabel($ends_at);
140
-                          })
141
-                         ->addColumn('status', function ($model) {
142
-                             $status = $model->order_status;
143
-
144
-                             return $status;
145
-                         })
133
+                            ->addColumn('version', function ($model) {
134
+                                return getVersionAndLabel($model->product_version, $model->product);
135
+                            })
136
+                            ->addColumn('expiry', function ($model) {
137
+                                $ends_at = strtotime($model->subscription_ends_at) > 1 ? $model->subscription_ends_at : '--';
138
+
139
+                                return getExpiryLabel($ends_at);
140
+                            })
141
+                            ->addColumn('status', function ($model) {
142
+                                $status = $model->order_status;
143
+
144
+                                return $status;
145
+                            })
146 146
                         ->addColumn('action', function ($model) {
147 147
                             return '<a href='.url('orders/'.$model->id)." 
148 148
                             class='btn btn-sm btn-secondary btn-xs'".tooltip('View')."<i class='fa fa-eye' 
@@ -174,27 +174,27 @@  discard block
 block discarded – undo
174 174
                             return $model->payment_method;
175 175
                         })
176 176
 
177
-                         ->addColumn('total', function ($model) use ($client, $extraAmt) {
178
-                             if ($model->invoice_id == 0) {
179
-                                 $amount = currencyFormat($extraAmt, $code = $client->currency);
180
-                             } else {
181
-                                 $amount = currencyFormat($model->amount, $code = $client->currency);
182
-                             }
183
-
184
-                             return $amount;
185
-                         })
186
-                         ->addColumn('status', function ($model) {
187
-                             return ucfirst($model->payment_status);
188
-                         })
189
-
190
-                         ->addColumn('action', function ($model) {
191
-                             '<input type="hidden" class="paymentid" value="{{$model->id}}">';
192
-                             if ($model->invoice_id == 0) {
193
-                                 return '<a href='.url('payments/'.$model->id.'/edit/')." class='btn btn-sm btn-secondary btn-xs' ".tooltip('Edit')." <i class='fa fa-edit' style='color:white;'> </i></a>";
194
-                             } else {
195
-                                 return '--';
196
-                             }
197
-                         })
177
+                            ->addColumn('total', function ($model) use ($client, $extraAmt) {
178
+                                if ($model->invoice_id == 0) {
179
+                                    $amount = currencyFormat($extraAmt, $code = $client->currency);
180
+                                } else {
181
+                                    $amount = currencyFormat($model->amount, $code = $client->currency);
182
+                                }
183
+
184
+                                return $amount;
185
+                            })
186
+                            ->addColumn('status', function ($model) {
187
+                                return ucfirst($model->payment_status);
188
+                            })
189
+
190
+                            ->addColumn('action', function ($model) {
191
+                                '<input type="hidden" class="paymentid" value="{{$model->id}}">';
192
+                                if ($model->invoice_id == 0) {
193
+                                    return '<a href='.url('payments/'.$model->id.'/edit/')." class='btn btn-sm btn-secondary btn-xs' ".tooltip('Edit')." <i class='fa fa-edit' style='color:white;'> </i></a>";
194
+                                } else {
195
+                                    return '--';
196
+                                }
197
+                            })
198 198
 
199 199
                         ->rawColumns(['checkbox', 'invoice_no', 'date', 'payment_method', 'total', 'status', 'action'])
200 200
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
         ->get();
20 20
 
21 21
         return\ DataTables::of($invoices)
22
-                        ->addColumn('checkbox', function ($model) {
22
+                        ->addColumn('checkbox', function($model) {
23 23
                             return "<input type='checkbox' class='invoice_checkbox' 
24 24
                             value=".$model->id.' name=select[] id=check>';
25 25
                         })
26
-                        ->addColumn('date', function ($model) {
26
+                        ->addColumn('date', function($model) {
27 27
                             return getDateHtml($model->date);
28 28
                         })
29
-                        ->addColumn('invoice_no', function ($model) {
29
+                        ->addColumn('invoice_no', function($model) {
30 30
                             $label = '<a href='.url('invoices/show?invoiceid='.$model->id).'>'.$model->number.'</a>';
31 31
                             if ($model->is_renewed) {
32 32
                                 return $label.'&nbsp;'.getStatusLabel('renewed');
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
                             return $label;
36 36
                         })
37
-                         ->addColumn('order_no', function ($model) {
37
+                         ->addColumn('order_no', function($model) {
38 38
                              if ($model->is_renewed) {
39 39
                                  return Order::find($model->order_id)->first()->getOrderLink($model->order_id, 'orders');
40 40
                              } else {
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
                                  return $orderArray;
48 48
                              }
49 49
                          })
50
-                        ->addColumn('total', function ($model) use ($client) {
50
+                        ->addColumn('total', function($model) use ($client) {
51 51
                             return currencyFormat($model->grand_total, $code = $client->currency);
52 52
                         })
53
-                         ->addColumn('paid', function ($model) use ($client) {
53
+                         ->addColumn('paid', function($model) use ($client) {
54 54
                              $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
55 55
                              $c = count($payment);
56 56
                              $sum = 0;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
                              return currencyFormat($sum, $code = $client->currency);
63 63
                          })
64
-                         ->addColumn('balance', function ($model) use ($client) {
64
+                         ->addColumn('balance', function($model) use ($client) {
65 65
                              $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get();
66 66
                              $c = count($payment);
67 67
                              $sum = 0;
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 
74 74
                              return currencyFormat($pendingAmount, $code = $client->currency);
75 75
                          })
76
-                          ->addColumn('status', function ($model) {
76
+                          ->addColumn('status', function($model) {
77 77
                               return getStatusLabel($model->status);
78 78
                           })
79
-                        ->addColumn('action', function ($model) {
79
+                        ->addColumn('action', function($model) {
80 80
                             $action = '';
81 81
                             $cont = new \App\Http\Controllers\Order\TaxRatesAndCodeExpiryController();
82 82
                             $check = $cont->checkExecution($model->id);
@@ -112,17 +112,17 @@  discard block
 block discarded – undo
112 112
             );
113 113
 
114 114
         return\ DataTables::of($order)
115
-                        ->addColumn('checkbox', function ($model) {
115
+                        ->addColumn('checkbox', function($model) {
116 116
                             return "<input type='checkbox' class='order_checkbox' 
117 117
                             value=".$model->id.' name=select[] id=checkorder>';
118 118
                         })
119
-                        ->addColumn('date', function ($model) {
119
+                        ->addColumn('date', function($model) {
120 120
                             return getDateHtml($model->created_at);
121 121
                         })
122
-                        ->addColumn('product', function ($model) {
122
+                        ->addColumn('product', function($model) {
123 123
                             return $model->product_name;
124 124
                         })
125
-                        ->addColumn('number', function ($model) {
125
+                        ->addColumn('number', function($model) {
126 126
                             $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>';
127 127
                             if ($model->subscription_updated_at) {//For few older clients subscription was not generated, so no updated_at column exists
128 128
                                 $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'.installationStatusLabel($model->subscription_updated_at, $model->subscription_created_at);
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
 
131 131
                             return $orderLink;
132 132
                         })
133
-                         ->addColumn('version', function ($model) {
133
+                         ->addColumn('version', function($model) {
134 134
                              return getVersionAndLabel($model->product_version, $model->product);
135 135
                          })
136
-                          ->addColumn('expiry', function ($model) {
136
+                          ->addColumn('expiry', function($model) {
137 137
                               $ends_at = strtotime($model->subscription_ends_at) > 1 ? $model->subscription_ends_at : '--';
138 138
 
139 139
                               return getExpiryLabel($ends_at);
140 140
                           })
141
-                         ->addColumn('status', function ($model) {
141
+                         ->addColumn('status', function($model) {
142 142
                              $status = $model->order_status;
143 143
 
144 144
                              return $status;
145 145
                          })
146
-                        ->addColumn('action', function ($model) {
146
+                        ->addColumn('action', function($model) {
147 147
                             return '<a href='.url('orders/'.$model->id)." 
148 148
                             class='btn btn-sm btn-secondary btn-xs'".tooltip('View')."<i class='fa fa-eye' 
149 149
                             style='color:white;'> </i></a>";
@@ -160,21 +160,21 @@  discard block
 block discarded – undo
160 160
         $extraAmt = $this->getExtraAmtPaid($id);
161 161
 
162 162
         return\ DataTables::of($payments)
163
-                        ->addColumn('checkbox', function ($model) {
163
+                        ->addColumn('checkbox', function($model) {
164 164
                             return "<input type='checkbox' class='payment_checkbox' 
165 165
                             value=".$model->id.' name=select[] id=checkpayment>';
166 166
                         })
167
-                        ->addColumn('invoice_no', function ($model) {
167
+                        ->addColumn('invoice_no', function($model) {
168 168
                             return $model->invoice()->count() ? '<a href='.url('invoices/show?invoiceid='.$model->invoice()->first()->id).'>'.$model->invoice()->first()->number.'</a><br>' : '--';
169 169
                         })
170
-                        ->addColumn('date', function ($model) {
170
+                        ->addColumn('date', function($model) {
171 171
                             return getDateHtml($model->created_at);
172 172
                         })
173
-                        ->addColumn('payment_method', function ($model) {
173
+                        ->addColumn('payment_method', function($model) {
174 174
                             return $model->payment_method;
175 175
                         })
176 176
 
177
-                         ->addColumn('total', function ($model) use ($client, $extraAmt) {
177
+                         ->addColumn('total', function($model) use ($client, $extraAmt) {
178 178
                              if ($model->invoice_id == 0) {
179 179
                                  $amount = currencyFormat($extraAmt, $code = $client->currency);
180 180
                              } else {
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 
184 184
                              return $amount;
185 185
                          })
186
-                         ->addColumn('status', function ($model) {
186
+                         ->addColumn('status', function($model) {
187 187
                              return ucfirst($model->payment_status);
188 188
                          })
189 189
 
190
-                         ->addColumn('action', function ($model) {
190
+                         ->addColumn('action', function($model) {
191 191
                              '<input type="hidden" class="paymentid" value="{{$model->id}}">';
192 192
                              if ($model->invoice_id == 0) {
193 193
                                  return '<a href='.url('payments/'.$model->id.'/edit/')." class='btn btn-sm btn-secondary btn-xs' ".tooltip('Edit')." <i class='fa fa-edit' style='color:white;'> </i></a>";
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,8 @@
 block discarded – undo
124 124
                         })
125 125
                         ->addColumn('number', function ($model) {
126 126
                             $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>';
127
-                            if ($model->subscription_updated_at) {//For few older clients subscription was not generated, so no updated_at column exists
127
+                            if ($model->subscription_updated_at) {
128
+//For few older clients subscription was not generated, so no updated_at column exists
128 129
                                 $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'.installationStatusLabel($model->subscription_updated_at, $model->subscription_created_at);
129 130
                             }
130 131
 
Please login to merge, or discard this patch.