Completed
Push — master ( e5cdd3...bf46ae )
by vijay
59:23
created
app/Http/Controllers/Api/ApiController.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers\Api;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-
7
-use App\Http\Requests;
8 6
 use App\Http\Controllers\Controller;
9 7
 use Exception;
10 8
 use App\Model\Order\Order;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
             $orders = new Order();
23 23
             $order = $orders->where('domain',$domain)->first();
24 24
             if($order){
25
-               $result = "success"; 
25
+                $result = "success"; 
26 26
             }
27 27
             return response()->json(compact('result'));
28 28
         } catch (Exception $ex) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@
 block discarded – undo
11 11
 
12 12
 class ApiController extends Controller
13 13
 {
14
-    public function checkDomain(Request $request){
15
-        try{
14
+    public function checkDomain(Request $request) {
15
+        try {
16 16
             $result = "fails";
17 17
             $domain = $request->input('url');
18 18
 
19 19
             if (ends_with($domain, '/')) {
20
-                $domain = substr_replace($domain,"", -1, 1);
20
+                $domain = substr_replace($domain, "", -1, 1);
21 21
             }
22 22
             $orders = new Order();
23
-            $order = $orders->where('domain',$domain)->first();
24
-            if($order){
23
+            $order = $orders->where('domain', $domain)->first();
24
+            if ($order) {
25 25
                $result = "success"; 
26 26
             }
27 27
             return response()->json(compact('result'));
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -316,6 +316,9 @@  discard block
 block discarded – undo
316 316
         }
317 317
     }
318 318
 
319
+    /**
320
+     * @param string $result
321
+     */
319 322
     public function submit($result, $url) {
320 323
         echo "<form action=$url method=post name=redirect>";
321 324
         echo '<input type=hidden name=_token value=csrf_token()/>';
@@ -390,6 +393,9 @@  discard block
 block discarded – undo
390 393
         }
391 394
     }
392 395
 
396
+    /**
397
+     * @param string $data
398
+     */
393 399
     public static function encryptByPublicKey($data) {
394 400
         $path = storage_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public.key';
395 401
         //dd($path);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         }
58 58
 
59 59
         echo "<form action=$url method=post name=redirect >";
60
-        echo '<input type=hidden name=_token value=' . csrf_token() . '>';
60
+        echo '<input type=hidden name=_token value='.csrf_token().'>';
61 61
         echo "<input type=hidden name=value value=$version />";
62 62
         echo '</form>';
63 63
         echo"<script language='javascript'>document.redirect.submit();</script>";
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         try {
129 129
             //$encrypted = p¥Ùn¿olÓ¥9)OÞݸÔvh§=Ìtt1rkC‰É§%YœfÐS\BâkHW€mùÌØg¹+VŠ¥²?áÙ{/<¶¡£e¡ˆr°(V)Öíàr„Ž]K9¤ÿÖ¡Åmž”üÈoò״µºŽ06¼e€rœ['4çhH¾ö:¨œ–S„œ¦,|¤ÇqÂrÈŸd+ml‡ uötφûóŽ&›áyÙ(ÆŒÁ$‘¥±Zj*îàÒöL‘ˆD†aɐö_§è¶°·V„Þú]%ÅR*B=žéršæñ*i+፭±èç|c¹Ñߟ­F$;
130 130
             // Get the private Key
131
-            $path = storage_path('app' . DIRECTORY_SEPARATOR . 'private.key');
131
+            $path = storage_path('app'.DIRECTORY_SEPARATOR.'private.key');
132 132
             $key_content = file_get_contents($path);
133 133
             if (!$privateKey = openssl_pkey_get_private($key_content)) {
134 134
                 die('Private Key failed');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             // Uncompress the unencrypted data.
154 154
             $output = gzuncompress($output);
155 155
             dd($output);
156
-            echo '<br /><br /> Unencrypted Data: ' . $output;
156
+            echo '<br /><br /> Unencrypted Data: '.$output;
157 157
         } catch (Exception $ex) {
158 158
             dd($ex);
159 159
         }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $envelope = $encrypted->envelope;
166 166
         $input = base64_decode($sealed_data);
167 167
         $einput = base64_decode($envelope);
168
-        $path = storage_path('app' . DIRECTORY_SEPARATOR . 'private.key');
168
+        $path = storage_path('app'.DIRECTORY_SEPARATOR.'private.key');
169 169
         $key_content = file_get_contents($path);
170 170
         $private_key = openssl_get_privatekey($key_content);
171 171
         $plaintext = NULL;
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     public function submit($result, $url) {
320 320
         echo "<form action=$url method=post name=redirect>";
321 321
         echo '<input type=hidden name=_token value=csrf_token()/>';
322
-        echo "<input type=hidden name=result value=" . $result . "/>";
322
+        echo "<input type=hidden name=result value=".$result."/>";
323 323
         echo '</form>';
324 324
         echo"<script language='javascript'>document.redirect.submit();</script>";
325 325
     }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     }
392 392
 
393 393
     public static function encryptByPublicKey($data) {
394
-        $path = storage_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public.key';
394
+        $path = storage_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'public.key';
395 395
         //dd($path);
396 396
         $key_content = file_get_contents($path);
397 397
         $public_key = openssl_get_publickey($key_content);
Please login to merge, or discard this patch.
app/Http/Controllers/Order/OrderController.php 7 patches
Doc Comments   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Switch Indentation   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
         //return \Datatable::query($this->order->select('id', 'created_at', 'client',
106 106
         //'price_override', 'order_status', 'number', 'serial_key'))
107 107
         return \Datatable::Collection($query->get())
108
-                        ->addColumn('#', function ($model) {
108
+                        ->addColumn('#', function($model) {
109 109
                             return "<input type='checkbox' value=".$model->id.' name=select[] id=check>';
110 110
                         })
111 111
                         ->showColumns('created_at')
112
-                        ->addColumn('client', function ($model) {
112
+                        ->addColumn('client', function($model) {
113 113
                             $user = $this->user->where('id', $model->client)->first();
114 114
                             $first = $user->first_name;
115 115
                             $last = $user->last_name;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>';
119 119
                         })
120 120
                         ->showColumns('number', 'price_override', 'order_status')
121
-                        ->addColumn('ends_at', function ($model) {
121
+                        ->addColumn('ends_at', function($model) {
122 122
                             $end = '--';
123 123
                             $ends = $model->subscription()->first();
124 124
                             if ($ends) {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
                             return $end;
133 133
                         })
134
-                        ->addColumn('action', function ($model) {
134
+                        ->addColumn('action', function($model) {
135 135
                             $sub = $model->subscription()->first();
136 136
                             $status = $this->checkInvoiceStatusByOrderId($model->id);
137 137
                             $url = '';
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
         $subject = $template->name;
684 684
         $data = $template->data;
685 685
         $replace = [
686
-            'name' => $user->first_name . ' ' . $user->last_name, 
686
+            'name' => $user->first_name.' '.$user->last_name, 
687 687
             'downloadurl' => $downloadurl, 
688 688
             'invoiceurl' => $invoiceurl,
689 689
             'product'=>$product,
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 
734 734
         return $product;
735 735
     }
736
-<<<<<<< HEAD
736
+<< << <<< HEAD
737 737
     
738 738
     public function subscription($orderid){
739 739
         $sub = $this->subscription->where('order_id',$orderid)->first();
@@ -749,10 +749,4 @@  discard block
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -7 removed lines patch added patch discarded remove patch
@@ -749,10 +749,4 @@
 block discarded – undo
749 749
     }
750 750
     
751 751
     public function renew($orderid){
752
-        //$sub = $this->subscription($orderid);
753
-        return url('my-orders');
754
-    }
755
-
756
-=======
757
->>>>>>> origin/master
758
-}
752
+        //$sub = $this->subscription($orderid
759 753
\ No newline at end of file
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
@@ -292,7 +292,7 @@
 block discarded – undo
292 292
     {
293 293
         try {
294 294
             $release = $this->latestRelese($owner, $repo);
295
-            if(key_exists('tag_name', $release)){
295
+            if (key_exists('tag_name', $release)) {
296 296
                 return $release['tag_name'];
297 297
             }
298 298
             return NULL;
Please login to merge, or discard this patch.
app/Http/Controllers/Common/CronController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $sub = $this->sub
46 46
                 ->where('ends_at', '!=', '0000-00-00 00:00:00')
47 47
                 ->whereNotNull('ends_at')
48
-                ->whereBetween('ends_at', [$plus29days,$plus31days]);
48
+                ->whereBetween('ends_at', [$plus29days, $plus31days]);
49 49
         //dd($sub->get());
50 50
 
51 51
         return $sub;
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         $templates = new \App\Model\Common\Template();
459 459
         $temp_id = $setting->subscription_going_to_end;
460 460
         //dd($setting);
461
-        if($end<date('Y-m-d H:m:i')){
461
+        if ($end < date('Y-m-d H:m:i')) {
462 462
             $temp_id = $setting->subscription_over;
463 463
         }
464 464
         //dd($temp_id);
Please login to merge, or discard this patch.
app/Http/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -356,12 +356,12 @@
 block discarded – undo
356 356
  * Api
357 357
  */
358 358
 
359
-Route::group(['prefix'=>'api'],function(){
359
+Route::group(['prefix'=>'api'], function() {
360 360
     /**
361 361
      * Unautherised requests
362 362
      */
363 363
     
364
-    Route::get('check-url','Api\ApiController@checkDomain');
364
+    Route::get('check-url', 'Api\ApiController@checkDomain');
365 365
     
366 366
 });
367 367
 
Please login to merge, or discard this patch.
app/Model/Product/Product.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@
 block discarded – undo
67 67
     }
68 68
     
69 69
     public function plan(){
70
-      $plan  = $this->planRelation()->first();
71
-      return $plan; 
70
+        $plan  = $this->planRelation()->first();
71
+        return $plan; 
72 72
     }
73 73
 
74 74
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     protected $fillable = ['name', 'description', 'type', 'group', 'file', 'image', 'require_domain', 'category',
11 11
         'stock_control', 'stock_qty', 'sort_order', 'tax_apply', 'retired', 'hidden', 'multiple_qty', 'auto_terminate',
12 12
         'setup_order_placed', 'setup_first_payment', 'setup_accept_manually', 'no_auto_setup', 'shoping_cart_link', 'process_url', 'github_owner', 'github_repository',
13
-        'deny_after_subscription', 'version', 'parent', 'subscription',];
13
+        'deny_after_subscription', 'version', 'parent', 'subscription', ];
14 14
 
15 15
     public function order() {
16 16
         return $this->hasMany('App\Model\Order\Order');
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 
64 64
     public function planRelation() {
65 65
         $related = "App\Model\Payment\Plan";
66
-        return $this->hasMany($related,'product');
66
+        return $this->hasMany($related, 'product');
67 67
     }
68 68
     
69
-    public function plan(){
70
-      $plan  = $this->planRelation()->first();
69
+    public function plan() {
70
+      $plan = $this->planRelation()->first();
71 71
       return $plan; 
72 72
     }
73 73
 
Please login to merge, or discard this patch.