Completed
Push — master ( fde4fb...b78da7 )
by vijay
111:36 queued 59:13
created
app/Model/Order/Order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         return $this->hasMany('App\Model\Order\OrderInvoiceRelation');
38 38
     }
39 39
     
40
-    public function invoiceItem(){
40
+    public function invoiceItem() {
41 41
         return $this->hasManyThrough('App\Model\Order\InvoiceItem', 'App\Model\Order\Invoice');
42 42
     }
43 43
 
Please login to merge, or discard this patch.
app/Http/routes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -290,12 +290,12 @@
 block discarded – undo
290 290
  * check version
291 291
  */
292 292
 
293
-Route::post('version','HomeController@version');
294
-Route::get('version','HomeController@getVersion');
295
-Route::get('version-test','HomeController@versionTest');
296
-Route::post('version-result','HomeController@versionResult');
297
-Route::post('verification','HomeController@faveoVerification');
298
-Route::post('download-url','Github\GithubController@getlatestReleaseForUpdate');
299
-Route::get('create-keys','HomeController@createEncryptionKeys');
300
-Route::get('encryption','HomeController@getEncryptedData');
293
+Route::post('version', 'HomeController@version');
294
+Route::get('version', 'HomeController@getVersion');
295
+Route::get('version-test', 'HomeController@versionTest');
296
+Route::post('version-result', 'HomeController@versionResult');
297
+Route::post('verification', 'HomeController@faveoVerification');
298
+Route::post('download-url', 'Github\GithubController@getlatestReleaseForUpdate');
299
+Route::get('create-keys', 'HomeController@createEncryptionKeys');
300
+Route::get('encryption', 'HomeController@getEncryptedData');
301 301
 
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
             if (!$this_order) {
228 228
                 return null;
229 229
             } else {
230
-               if($this_order->serial_key == $faveo_decrypted_key){
231
-                   return $this_order->serial_key;
232
-               }
230
+                if($this_order->serial_key == $faveo_decrypted_key){
231
+                    return $this_order->serial_key;
232
+                }
233 233
             }
234 234
             return null;
235 235
         } catch (Exception $ex) {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
             $order = new Order();
275 275
             $this_order = $order
276 276
                     ->where('number', $order_number)
277
-                   // ->where('serial_key', $serial_key)
277
+                    // ->where('serial_key', $serial_key)
278 278
                     ->where('domain', $domain)
279 279
                     ->first();
280 280
             return $this_order;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         }
220 220
     }
221 221
 
222
-    public function checkSerialKey($faveo_encrypted_key,$order_number) {
222
+    public function checkSerialKey($faveo_encrypted_key, $order_number) {
223 223
         try {
224 224
             $order = new Order();
225 225
             $faveo_decrypted_key = self::decryptByFaveoPrivateKey($faveo_encrypted_key);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             if (!$this_order) {
228 228
                 return null;
229 229
             } else {
230
-               if($this_order->serial_key == $faveo_decrypted_key){
230
+               if ($this_order->serial_key == $faveo_decrypted_key) {
231 231
                    return $this_order->serial_key;
232 232
                }
233 233
             }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             $faveo_version = $request->input('version');
294 294
             $order_number = $this->checkOrder($faveo_encrypted_order_number);
295 295
             $domain = $this->checkDomain($url);
296
-            $serial_key = $this->checkSerialKey($faveo_encrypted_key,$order_number);
296
+            $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number);
297 297
             //return $serial_key;
298 298
             $result = [];
299 299
             if ($request_type == 'install') {
@@ -350,11 +350,11 @@  discard block
 block discarded – undo
350 350
             $this_order = $order->where('number', $order_number)->first();
351 351
             if ($this_order) {
352 352
                 $product_id = $this_order->product;
353
-                if($product_id){
354
-                    $this_product = $product->where('id',$product_id)->first();
355
-                    if($this_product){
353
+                if ($product_id) {
354
+                    $this_product = $product->where('id', $product_id)->first();
355
+                    if ($this_product) {
356 356
                         $version = str_replace('v', '', $this_product->version);
357
-                        return ['status' => 'success', 'message' => 'This is a valid request','version'=>$version];
357
+                        return ['status' => 'success', 'message' => 'This is a valid request', 'version'=>$version];
358 358
                     }
359 359
                 }
360 360
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
     public function GetTemplates()
88 88
     {
89 89
         return \Datatable::collection($this->template->select('id', 'name', 'type')->get())
90
-                        ->addColumn('#', function ($model) {
90
+                        ->addColumn('#', function($model) {
91 91
                             return "<input type='checkbox' value=".$model->id.' name=select[] id=check>';
92 92
                         })
93 93
                         ->showColumns('name')
94
-                        ->addColumn('type', function ($model) {
94
+                        ->addColumn('type', function($model) {
95 95
                             return $this->type->where('id', $model->type)->first()->name;
96 96
                         })
97
-                        ->addColumn('action', function ($model) {
97
+                        ->addColumn('action', function($model) {
98 98
                             return '<a href='.url('templates/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>";
99 99
                         })
100 100
                         ->searchColumns('name')
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             $data = str_replace($array1, $array2, $data);
253 253
             $settings = \App\Model\Common\Setting::find(1);
254 254
             $fromname = $settings->company;
255
-            \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
255
+            \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
256 256
 
257 257
                 $m->from($from, $fromname);
258 258
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
             }
525 525
             $geoip_state_array = \App\Http\Controllers\Front\CartController::getStateByCode($state_code);
526 526
             if ($geoip_state == '') {
527
-                if(key_exists('id', $geoip_state_array)){
527
+                if (key_exists('id', $geoip_state_array)) {
528 528
                     $geoip_state = $geoip_state_array['id'];
529 529
                 }
530 530
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CheckoutController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@
 block discarded – undo
173 173
             $invoice->save();
174 174
             //dd($invoice->id);
175 175
 
176
-            $invoice_items = $this->invoiceItem->where('invoice_id',$invoice->id)->first();
176
+            $invoice_items = $this->invoiceItem->where('invoice_id', $invoice->id)->first();
177 177
             $product = $invoice_items->product_name;
178 178
 
179 179
             $user_id = \Auth::user()->id;
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
     public function getOrders()
87 87
     {
88 88
         //        try{
89
-           $orders = $this->order
90
-                   ->where('client', \Auth::user()->id);
91
-                   //->select('id','product','created_at')
89
+            $orders = $this->order
90
+                    ->where('client', \Auth::user()->id);
91
+                    //->select('id','product','created_at')
92 92
 
93 93
             return \Datatable::query($orders)
94 94
                         ->addColumn('id', function ($model) {
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
             $plan = $subscription->plan()->first();
231 231
             $product = $order->product()->first();
232 232
             $price = $product->price()->first();
233
-           //dd($price);
234
-           $user = \Auth::user();
233
+            //dd($price);
234
+            $user = \Auth::user();
235 235
 
236 236
             return view('themes.default1.front.clients.show-order', compact('invoice', 'order', 'user', 'plan', 'product', 'subscription'));
237 237
         } catch (Exception $ex) {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                             if(\Auth::user()->role=='admin'){
274 274
                                 $url = '/invoices/show?invoiceid='.$model->id;
275 275
                             }else{
276
-                               $url = 'my-invoice';
276
+                                $url = 'my-invoice';
277 277
                             }
278 278
                              
279 279
                             return '<a href=' . url($url.'/' . $model->id) . " class='btn btn-sm btn-primary'>View</a>";
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
                     ->select('number', 'created_at', 'grand_total', 'id');
57 57
 
58 58
             return \Datatable::query($invoices)
59
-                        ->addColumn('number', function ($model) {
59
+                        ->addColumn('number', function($model) {
60 60
                             return $model->number;
61 61
                         })
62 62
                         ->showColumns('created_at')
63
-                        ->addColumn('total', function ($model) {
63
+                        ->addColumn('total', function($model) {
64 64
                             return $model->grand_total;
65 65
                         })
66
-                        ->addColumn('action', function ($model) {
66
+                        ->addColumn('action', function($model) {
67 67
                             return '<a href='.url('my-invoice/'.$model->id)." class='btn btn-sm btn-primary'>View</a>";
68 68
                         })
69 69
                         ->searchColumns('number', 'created_at', 'total')
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
                    //->select('id','product','created_at')
92 92
 
93 93
             return \Datatable::query($orders)
94
-                        ->addColumn('id', function ($model) {
94
+                        ->addColumn('id', function($model) {
95 95
                             return $model->id;
96 96
                         })
97 97
 
98
-                        ->addColumn('product', function ($model) {
98
+                        ->addColumn('product', function($model) {
99 99
                             return $model->product()->first()->name;
100 100
                         })
101 101
                         ->showColumns('created_at')
102
-                        ->addColumn('ends_at', function ($model) {
102
+                        ->addColumn('ends_at', function($model) {
103 103
                             $end = $model->subscription()->first()->ends_at;
104 104
                             if ($end == '0000-00-00 00:00:00' || $end == null) {
105 105
                                 $end = '--';
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
                             return $end;
109 109
                         })
110
-                        ->addColumn('action', function ($model) {
110
+                        ->addColumn('action', function($model) {
111 111
                             //dd($model);
112 112
                             return '<a href='.url('my-order/'.$model->id)." class='btn btn-sm btn-primary'>Details</a>"
113 113
                                     .'  <a href='.url('my-invoice/'.$model->invoice()->first()->id)." class='btn btn-sm btn-primary'>Invoice</a>"
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
             $subscriptions = $this->subscription->where('user_id', \Auth::user()->id)->get();
137 137
 
138 138
             return \Datatable::collection($subscriptions)
139
-                        ->addColumn('id', function ($model) {
139
+                        ->addColumn('id', function($model) {
140 140
                             return $model->id;
141 141
                         })
142 142
                         ->showColumns('created_at')
143 143
 
144
-                        ->addColumn('ends_at', function ($model) {
144
+                        ->addColumn('ends_at', function($model) {
145 145
                             return $model->subscription()->first()->ends_at;
146 146
                         })
147 147
                         ->searchColumns('id', 'created_at', 'ends_at')
@@ -257,26 +257,26 @@  discard block
 block discarded – undo
257 257
                     ->select('number', 'created_at', 'grand_total', 'id');
258 258
 
259 259
             return \Datatable::query($invoices)
260
-                        ->addColumn('number', function ($model) {
260
+                        ->addColumn('number', function($model) {
261 261
                             return $model->number;
262 262
                         })
263
-                        ->addColumn('invoice_item', function ($model) {
263
+                        ->addColumn('invoice_item', function($model) {
264 264
                             $products = $model->invoiceItem()->lists('product_name')->toArray();
265 265
                             
266 266
                             return ucfirst(implode(',', $products));
267 267
                         })
268 268
                         ->showColumns('created_at')
269
-                        ->addColumn('total', function ($model) {
269
+                        ->addColumn('total', function($model) {
270 270
                             return $model->grand_total;
271 271
                         })
272
-                        ->addColumn('action', function ($model) {
273
-                            if(\Auth::user()->role=='admin'){
272
+                        ->addColumn('action', function($model) {
273
+                            if (\Auth::user()->role == 'admin') {
274 274
                                 $url = '/invoices/show?invoiceid='.$model->id;
275
-                            }else{
275
+                            } else {
276 276
                                $url = 'my-invoice';
277 277
                             }
278 278
                              
279
-                            return '<a href=' . url($url.'/' . $model->id) . " class='btn btn-sm btn-primary'>View</a>";
279
+                            return '<a href='.url($url.'/'.$model->id)." class='btn btn-sm btn-primary'>View</a>";
280 280
 
281 281
                         })
282 282
                         ->searchColumns('number', 'created_at', 'grand_total')
@@ -296,11 +296,11 @@  discard block
 block discarded – undo
296 296
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
297 297
 
298 298
             return \Datatable::query($payments)
299
-                        ->addColumn('number', function ($model) {
299
+                        ->addColumn('number', function($model) {
300 300
                             return $model->invoice()->first()->number;
301 301
                         })
302 302
                         ->showColumns('amount', 'payment_method', 'payment_status')
303
-                        ->addColumn('total', function ($model) {
303
+                        ->addColumn('total', function($model) {
304 304
                             return $model->grand_total;
305 305
                         })
306 306
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
                             }
67 67
                             if(!empty($result)){
68 68
                             return implode(',', $result);
69
-                            }else{
69
+                            } else{
70 70
                                 return 'None';
71 71
                             }
72 72
                         })
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 
84 84
         // try {
85 85
         return \Datatable::collection($this->product->select('id', 'name', 'type', 'group')->where('id', '!=', 1)->get())
86
-                        ->addColumn('#', function ($model) {
86
+                        ->addColumn('#', function($model) {
87 87
                             return "<input type='checkbox' value=".$model->id.' name=select[] id=check>';
88 88
                         })
89
-                        ->addColumn('name', function ($model) {
89
+                        ->addColumn('name', function($model) {
90 90
                             return ucfirst($model->name);
91 91
                         })
92
-                        ->addColumn('type', function ($model) {
92
+                        ->addColumn('type', function($model) {
93 93
                             //dd($model->type());
94 94
                             if ($this->type->where('id', $model->type)->first()) {
95 95
                                 return $this->type->where('id', $model->type)->first()->name;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                                 return 'Not available';
98 98
                             }
99 99
                         })
100
-                        ->addColumn('group', function ($model) {
100
+                        ->addColumn('group', function($model) {
101 101
                             //dd($model->type());
102 102
                             if ($this->group->where('id', $model->group)->first()) {
103 103
                                 return $this->group->where('id', $model->group)->first()->name;
@@ -105,21 +105,21 @@  discard block
 block discarded – undo
105 105
                                 return 'Not available';
106 106
                             }
107 107
                         })
108
-                        ->addColumn('price', function ($model) {
108
+                        ->addColumn('price', function($model) {
109 109
                             if ($this->price->where('product_id', $model->id)->first()) {
110 110
                                 return $this->price->where('product_id', $model->id)->first()->price;
111 111
                             } else {
112 112
                                 return 'Not available';
113 113
                             }
114 114
                         })
115
-                        ->addColumn('currency', function ($model) {
115
+                        ->addColumn('currency', function($model) {
116 116
                             if ($this->price->where('product_id', $model->id)->first()) {
117 117
                                 return $this->price->where('product_id', $model->id)->first()->currency;
118 118
                             } else {
119 119
                                 return 'Not available';
120 120
                             }
121 121
                         })
122
-                        ->addColumn('action', function ($model) {
122
+                        ->addColumn('action', function($model) {
123 123
                             return '<a href='.url('products/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>";
124 124
                         })
125 125
                         ->searchColumns('name', 'email')
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
                     'currency.*'   => 'required',
175 175
                     'price.*'      => 'required',
176 176
         ]);
177
-        $v->sometimes(['file', 'image', 'version'], 'required', function ($input) {
177
+        $v->sometimes(['file', 'image', 'version'], 'required', function($input) {
178 178
             return $input->type == 2 && $input->github_owner == '' && $input->github_repository == '';
179 179
         });
180 180
 
181
-        $v->sometimes(['github_owner', 'github_repository'], 'required', function ($input) {
181
+        $v->sometimes(['github_owner', 'github_repository'], 'required', function($input) {
182 182
             return $input->type == 2 && $input->file == '' && $input->image == '';
183 183
         });
184 184
         if ($v->fails()) {
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                     'currency.*'   => 'required',
300 300
                     'price.*'      => 'required',
301 301
         ]);
302
-        $v->sometimes(['file', 'image', 'version'], 'required', function ($input) {
302
+        $v->sometimes(['file', 'image', 'version'], 'required', function($input) {
303 303
             return $input->type == 2 && $input->github_owner == '' && $input->github_repository == '';
304 304
         });
305 305
 
306
-        $v->sometimes(['github_owner', 'github_repository'], 'required', function ($input) {
306
+        $v->sometimes(['github_owner', 'github_repository'], 'required', function($input) {
307 307
             return $input->type == 2 && $input->file == '' && $input->image == '';
308 308
         });
309 309
         if ($v->fails()) {
@@ -507,14 +507,14 @@  discard block
 block discarded – undo
507 507
             $price = $product
508 508
                     ->price()
509 509
                     ->where('product_id', $id)
510
-                    ->where('currency',$currency)
510
+                    ->where('currency', $currency)
511 511
                     ->first()
512 512
                     ->sales_price;
513 513
             if (!$price) {
514 514
                 $price = $product
515 515
                     ->price()
516 516
                     ->where('product_id', $id)
517
-                    ->where('currency',$currency)
517
+                    ->where('currency', $currency)
518 518
                     ->first()
519 519
                     ->price;
520 520
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Github/GithubController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@
 block discarded – undo
305 305
         $product = \App\Model\Product\Product::where('name', $name)->first();
306 306
         $owner = $product->github_owner;
307 307
         $repo = $product->github_repository;
308
-        $release  = $this->latestRelese($owner, $repo);
308
+        $release = $this->latestRelese($owner, $repo);
309 309
         return json_encode($release);
310 310
     }
311 311
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/AuthController.php 1 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
         $this->validate($request, [
73 73
             'email1' => 'required', 'password1' => 'required',
74
-                ],  [
74
+                ], [
75 75
             'email1.required'    => 'Username/Email is required',
76 76
             'password1.required' => 'Password is required',
77 77
         ]);
Please login to merge, or discard this patch.