Completed
Push — development ( 877883...280d38 )
by Ashutosh
10:04
created
app/Http/Controllers/Front/BaseClientController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,9 +200,9 @@
 block discarded – undo
200 200
                         ->select('number', 'created_at', 'grand_total', 'id', 'status');
201 201
             }
202 202
             return \DataTables::of($invoices->get())
203
-             ->addColumn('number', function ($model) {
204
-                 return $model->number;
205
-             })
203
+                ->addColumn('number', function ($model) {
204
+                    return $model->number;
205
+                })
206 206
             ->addColumn('products', function ($model) {
207 207
                 $invoice = $this->invoice->find($model->id);
208 208
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -193,34 +193,34 @@
 block discarded – undo
193 193
             $relation = $order->invoiceRelation()->pluck('invoice_id')->toArray();
194 194
             $invoice = new Invoice();
195 195
             $invoices = $invoice
196
-                    ->select('number', 'created_at', 'grand_total','currency', 'id', 'status')
196
+                    ->select('number', 'created_at', 'grand_total', 'currency', 'id', 'status')
197 197
                     ->whereIn('id', $relation);
198 198
             if ($invoices->get()->count() == 0) {
199 199
                 $invoices = $order->invoice()
200 200
                         ->select('number', 'created_at', 'grand_total', 'id', 'status');
201 201
             }
202 202
             return \DataTables::of($invoices->get())
203
-             ->addColumn('number', function ($model) {
203
+             ->addColumn('number', function($model) {
204 204
                  return $model->number;
205 205
              })
206
-            ->addColumn('products', function ($model) {
206
+            ->addColumn('products', function($model) {
207 207
                 $invoice = $this->invoice->find($model->id);
208 208
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
209 209
 
210 210
                 return ucfirst(implode(',', $products));
211 211
             })
212
-            ->addColumn('date', function ($model) {
212
+            ->addColumn('date', function($model) {
213 213
                 $date = date_create($model->created_at);
214 214
 
215 215
                 return date_format($date, 'M j, Y, g:i a');
216 216
             })
217
-            ->addColumn('total', function ($model) {
218
-                return currency_format($model->grand_total,$code =$model->currency);
217
+            ->addColumn('total', function($model) {
218
+                return currency_format($model->grand_total, $code = $model->currency);
219 219
             })
220
-            ->addColumn('status', function ($model) {
220
+            ->addColumn('status', function($model) {
221 221
                 return ucfirst($model->status);
222 222
             })
223
-            ->addColumn('action', function ($model) {
223
+            ->addColumn('action', function($model) {
224 224
                 if (\Auth::user()->role == 'admin') {
225 225
                     $url = '/invoices/show?invoiceid='.$model->id;
226 226
                 } else {
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CheckoutController.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function checkoutForm(Request $request)
83 83
     {
84
-        if (!\Auth::user()) {//If User is not Logged in then send him to login Page
84
+        if (!\Auth::user()) {
85
+//If User is not Logged in then send him to login Page
85 86
             $url = $request->segments(); //The requested url (chekout).Save it in Session
86 87
             \Session::put('session-url', $url[0]);
87 88
             $content = Cart::getContent();
@@ -107,7 +108,8 @@  discard block
 block discarded – undo
107 108
 
108 109
         try {
109 110
             $domain = $request->input('domain');
110
-            if ($domain) {//Store the Domain  in session when user Logged In
111
+            if ($domain) {
112
+//Store the Domain  in session when user Logged In
111 113
                 foreach ($domain as $key => $value) {
112 114
                     \Session::put('domain'.$key, $value);
113 115
                 }
@@ -132,7 +134,8 @@  discard block
 block discarded – undo
132 134
     public function getAttributes($content)
133 135
     {
134 136
         try {
135
-            if (count($content) > 0) {//after ProductPurchase this is not true as cart is cleared
137
+            if (count($content) > 0) {
138
+//after ProductPurchase this is not true as cart is cleared
136 139
                 foreach ($content as $key => $item) {
137 140
                     $attributes[] = $item->attributes;
138 141
                     $cart_currency = $attributes[0]['currency']['currency']; //Get the currency of Product in the cart
@@ -174,8 +177,9 @@  discard block
 block discarded – undo
174 177
             // dd($items);
175 178
             if ($invoice) {
176 179
                 $items = $invoice->invoiceItem()->get();
177
-                if (count($items > 0))
178
-                $product = $this->product($invoiceid);
180
+                if (count($items > 0)) {
181
+                                $product = $this->product($invoiceid);
182
+                }
179 183
             }
180 184
 
181 185
             return view('themes.default1.front.paynow', compact('invoice', 'items', 'product'));
Please login to merge, or discard this patch.
app/Http/Controllers/Front/PageController.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
                         })
62 62
                         ->addColumn('created_at', function ($model) {
63 63
                             $created = $model->created_at;
64
-                             if ($created) {
65
-                                  $date1 = new \DateTime($created);
66
-                                  $tz = \Auth::user()->timezone()->first()->name;
67
-                                  $date1->setTimezone(new \DateTimeZone($tz));
68
-                                  $createdate = $date1->format('M j, Y, g:i a ');
69
-                              }
64
+                                if ($created) {
65
+                                    $date1 = new \DateTime($created);
66
+                                    $tz = \Auth::user()->timezone()->first()->name;
67
+                                    $date1->setTimezone(new \DateTimeZone($tz));
68
+                                    $createdate = $date1->format('M j, Y, g:i a ');
69
+                                }
70 70
                             return $createdate;
71 71
                         })
72 72
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
78 78
                         })
79 79
 
80
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
80
+                            ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
81 81
                         ->make(true);
82 82
         // ->searchColumns('name', 'content')
83 83
                         // ->orderColumns('name')
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
     public function getPages()
50 50
     {
51 51
         return \DataTables::of($this->page->get())
52
-                        ->addColumn('checkbox', function ($model) {
52
+                        ->addColumn('checkbox', function($model) {
53 53
                             return "<input type='checkbox' class='page_checkbox' 
54 54
                             value=".$model->id.' name=select[] id=check>';
55 55
                         })
56
-                        ->addColumn('name', function ($model) {
56
+                        ->addColumn('name', function($model) {
57 57
                             return ucfirst($model->name);
58 58
                         })
59
-                        ->addColumn('url', function ($model) {
59
+                        ->addColumn('url', function($model) {
60 60
                             return $model->url;
61 61
                         })
62
-                        ->addColumn('created_at', function ($model) {
62
+                        ->addColumn('created_at', function($model) {
63 63
                             $created = $model->created_at;
64 64
                              if ($created) {
65 65
                                   $date1 = new \DateTime($created);
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
                         })
72 72
 
73 73
                 
74
-                        ->addColumn('action', function ($model) {
74
+                        ->addColumn('action', function($model) {
75 75
                             return '<a href='.url('pages/'.$model->id.'/edit')
76 76
                             ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
77 77
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
78 78
                         })
79 79
 
80
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
80
+                          ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'action'])
81 81
                         ->make(true);
82 82
         // ->searchColumns('name', 'content')
83 83
                         // ->orderColumns('name')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             $selectedParent = $this->page->where('id', $id)->pluck('parent_page_id')->toArray();
110 110
             $parentName = $this->page->where('id', $selectedParent)->pluck('name', 'id')->toArray();
111 111
 
112
-            return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate','selectedParent',
112
+            return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate', 'selectedParent',
113 113
                 'parentName'));
114 114
         } catch (\Exception $ex) {
115 115
             return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $from = $request->input('from');
109 109
             $till = $request->input('till');
110 110
 
111
-            return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from',
111
+            return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from',
112 112
 
113 113
                 'till'));
114 114
         } catch (\Exception $ex) {
@@ -131,35 +131,35 @@  discard block
 block discarded – undo
131 131
         return \DataTables::of($query->take(100))
132 132
          ->setTotalRecords($query->count())
133 133
 
134
-         ->addColumn('checkbox', function ($model) {
134
+         ->addColumn('checkbox', function($model) {
135 135
              return "<input type='checkbox' class='invoice_checkbox' 
136 136
                             value=".$model->id.' name=select[] id=check>';
137 137
          })
138
-                        ->addColumn('user_id', function ($model) {
138
+                        ->addColumn('user_id', function($model) {
139 139
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
140 140
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
141 141
                             $id = $this->user->where('id', $model->user_id)->first()->id;
142 142
 
143 143
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
144 144
                         })
145
-                         ->addColumn('number', function ($model) {
145
+                         ->addColumn('number', function($model) {
146 146
                              return ucfirst($model->number);
147 147
                          })
148 148
 
149
-                        ->addColumn('date', function ($model) {
149
+                        ->addColumn('date', function($model) {
150 150
                             $date = ($model->created_at);
151 151
 
152 152
                             return $date;
153 153
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
154 154
                         })
155
-                         ->addColumn('grand_total', function ($model) {
155
+                         ->addColumn('grand_total', function($model) {
156 156
                              return $model->grand_total;
157 157
                          })
158
-                          ->addColumn('status', function ($model) {
158
+                          ->addColumn('status', function($model) {
159 159
                               return ucfirst($model->status);
160 160
                           })
161 161
 
162
-                        ->addColumn('action', function ($model) {
162
+                        ->addColumn('action', function($model) {
163 163
                             $action = '';
164 164
 
165 165
                             $check = $this->checkExecution($model->id);
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
176 176
                                     ."   $action";
177 177
                         })
178
-                         ->filterColumn('user_id', function ($query, $keyword) {
178
+                         ->filterColumn('user_id', function($query, $keyword) {
179 179
                              $sql = 'first_name like ?';
180 180
                              $query->whereRaw($sql, ["%{$keyword}%"]);
181 181
                          })
182 182
 
183
-                          ->filterColumn('status', function ($query, $keyword) {
183
+                          ->filterColumn('status', function($query, $keyword) {
184 184
                               $sql = 'status like ?';
185 185
                               $query->whereRaw($sql, ["%{$keyword}%"]);
186 186
                           })
187 187
 
188
-                        ->filterColumn('number', function ($query, $keyword) {
188
+                        ->filterColumn('number', function($query, $keyword) {
189 189
                             $sql = 'number like ?';
190 190
                             $query->whereRaw($sql, ["%{$keyword}%"]);
191 191
                         })
192
-                         ->filterColumn('grand_total', function ($query, $keyword) {
192
+                         ->filterColumn('grand_total', function($query, $keyword) {
193 193
                              $sql = 'grand_total like ?';
194 194
                              $query->whereRaw($sql, ["%{$keyword}%"]);
195 195
                          })
196
-                          ->filterColumn('date', function ($query, $keyword) {
196
+                          ->filterColumn('date', function($query, $keyword) {
197 197
                               $sql = 'date like ?';
198 198
                               $query->whereRaw($sql, ["%{$keyword}%"]);
199 199
                           })
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 
360 360
     public function invoiceGenerateByForm(Request $request, $user_id = '')
361 361
     {
362
-        $this->validate($request,[
362
+        $this->validate($request, [
363 363
 
364 364
                 'plan'      => 'required_if:subscription,true',
365 365
                 'price'     => 'required',
366
-            ],[
366
+            ], [
367 367
                 'plan.required_if' =>'Select a Plan',
368 368
             ]);
369 369
         try {
Please login to merge, or discard this patch.
app/Http/Controllers/Order/BaseOrderController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $this->addOrderInvoiceRelation($invoiceid, $order->id);
109 109
             if ($planid != 0) {
110 110
             $this->addSubscription($order->id, $plan_id, $version, $product, $serial_key);
111
-           }
111
+            }
112 112
             $this->sendOrderMail($user_id, $order->id, $item->id);
113 113
             //Update Subscriber To Mailchimp
114 114
             $mailchimpStatus = StatusSetting::pluck('mailchimp_status')->first();
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         $data = $template->data;
293 293
         $replace = [
294 294
             'name'          => $user->first_name.' '.$user->last_name,
295
-             'serialkeyurl' => $myaccounturl,
295
+                'serialkeyurl' => $myaccounturl,
296 296
             'downloadurl'   => $downloadurl,
297 297
             'invoiceurl'    => $invoiceurl,
298 298
             'product'       => $product,
Please login to merge, or discard this patch.
app/Http/Controllers/Payment/PromotionController.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                             ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
88 88
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
89 89
                         })
90
-                         ->rawColumns(['checkbox', 'code', 'products', 'action'])
90
+                            ->rawColumns(['checkbox', 'code', 'products', 'action'])
91 91
 
92 92
                         ->make(true);
93 93
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $this->promotion->uses = $request->input('uses');
128 128
             $this->promotion->start = $start;
129 129
             $this->promotion->expiry = $expiry;
130
-             $this->promotion->save();
130
+                $this->promotion->save();
131 131
             //dd($this->promotion);
132 132
             $products = $request->input('applied');
133 133
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             ->pluck('product_id', 'product_id')->toArray();
160 160
 
161 161
             return view('themes.default1.payment.promotion.edit',
162
-             compact('product', 'promotion', 'selectedProduct', 'type'));
162
+                compact('product', 'promotion', 'selectedProduct', 'type'));
163 163
         } catch (\Exception $ex) {
164 164
             return redirect()->back()->with('fails', $ex->getMessage());
165 165
         }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     public function update($id, PromotionRequest $request)
176 176
     {
177 177
         try {
178
-             $startdate = date_create($request->input('start'));
178
+                $startdate = date_create($request->input('start'));
179 179
             $start = date_format($startdate, 'Y-m-d H:m:i');
180 180
             $enddate = date_create($request->input('expiry'));
181 181
             $expiry =  date_format($enddate, 'Y-m-d H:m:i');
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
 
278 278
             $userId = \Auth::user()->id;
279 279
             \Cart::update($productid, [
280
-           'id'        => $productid,
281
-           'price'     => $value,
282
-          'conditions' => $coupon,
280
+            'id'        => $productid,
281
+            'price'     => $value,
282
+            'conditions' => $coupon,
283 283
 
284
-           // new item price, price can also be a string format like so: '98.67'
285
-          ]);
284
+            // new item price, price can also be a string format like so: '98.67'
285
+            ]);
286 286
             $items = \Cart::getContent();
287 287
             \Session::put('items', $items);
288 288
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
         $new_promotion = $this->promotion->select('code', 'type', 'id')->get();
60 60
 
61 61
         return\ DataTables::of($new_promotion)
62
-                            ->addColumn('checkbox', function ($model) {
62
+                            ->addColumn('checkbox', function($model) {
63 63
                                 return "<input type='checkbox' class='promotion_checkbox'
64 64
                                  value=".$model->id.' name=select[] id=check>';
65 65
                             })
66
-                        ->addColumn('code', function ($model) {
66
+                        ->addColumn('code', function($model) {
67 67
                             return ucfirst($model->code);
68 68
                         })
69
-                        ->addColumn('type', function ($model) {
69
+                        ->addColumn('type', function($model) {
70 70
                             return $this->type->where('id', $model->type)->first()->name;
71 71
                         })
72
-                        ->addColumn('products', function ($model) {
72
+                        ->addColumn('products', function($model) {
73 73
                             $selected = $this->promoRelation->select('product_id')
74 74
                             ->where('promotion_id', $model->id)->get();
75 75
                             $result = [];
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                                 return 'None';
83 83
                             }
84 84
                         })
85
-                        ->addColumn('action', function ($model) {
85
+                        ->addColumn('action', function($model) {
86 86
                             return '<a href='.url('promotions/'.$model->id.'/edit')
87 87
                             ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
88 88
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $startdate = date_create($request->input('start'));
121 121
             $start = date_format($startdate, 'Y-m-d H:m:i');
122 122
             $enddate = date_create($request->input('expiry'));
123
-            $expiry =  date_format($enddate, 'Y-m-d H:m:i');
123
+            $expiry = date_format($enddate, 'Y-m-d H:m:i');
124 124
             $this->promotion->code = $request->input('code');
125 125
             $this->promotion->type = $request->input('type');
126 126
             $this->promotion->value = $request->input('value');
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
              $startdate = date_create($request->input('start'));
179 179
             $start = date_format($startdate, 'Y-m-d H:m:i');
180 180
             $enddate = date_create($request->input('expiry'));
181
-            $expiry =  date_format($enddate, 'Y-m-d H:m:i');
181
+            $expiry = date_format($enddate, 'Y-m-d H:m:i');
182 182
 
183 183
             $promotion = $this->promotion->where('id', $id)->update([
184 184
             'code' => $request->input('code'),
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number);
96 96
 
97 97
             \Log::emergency(json_encode(['domain' => $request->input('domain'),
98
-             'serial'                             => $serial_key, 'order' => $order_number, ]));
98
+                'serial'                             => $serial_key, 'order' => $order_number, ]));
99 99
             $result = [];
100 100
             if ($request_type == 'install') {
101 101
                 $result = $this->verificationResult($order_number, $serial_key);
@@ -343,13 +343,13 @@  discard block
 block discarded – undo
343 343
     public function downloadForFaveo(Request $request, Order $order)
344 344
     {
345 345
     try {
346
-             $faveo_encrypted_order_number = $request->input('order_number');
346
+                $faveo_encrypted_order_number = $request->input('order_number');
347 347
             $faveo_serial_key = $request->input('serial_key');
348 348
             $orderSerialKey = $order->where('number', $faveo_encrypted_order_number)
349 349
                     ->value('serial_key');
350 350
 
351 351
             $this_order = $order
352
-                     ->where('number', $faveo_encrypted_order_number)
352
+                        ->where('number', $faveo_encrypted_order_number)
353 353
                     ->first();
354 354
             if ($this_order && $orderSerialKey == $faveo_serial_key) {
355 355
                 $product_id = $this_order->product;
Please login to merge, or discard this patch.
app/Traits/PaymentsAndInvoices.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                 $paymentid = $request->input('id');
29 29
                 $creditAmtUserId = $this->payment->where('id', $paymentid)->value('user_id');
30 30
                 $creditAmt = $this->payment->where('user_id', $creditAmtUserId)
31
-                  ->where('invoice_id', '=', 0)->value('amt_to_credit');
31
+                    ->where('invoice_id', '=', 0)->value('amt_to_credit');
32 32
                 $invoices = $invoice->where('user_id', $creditAmtUserId)->orderBy('created_at', 'desc')->get();
33 33
                 $cltCont = new \App\Http\Controllers\User\ClientController();
34 34
                 $invoiceSum = $cltCont->getTotalInvoice($invoices);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $payment_method,
62 62
         $invoiceid,
63 63
         $amount,
64
-       $parent_id = '',
64
+        $parent_id = '',
65 65
         $userid = '',
66 66
         $payment_status = 'pending'
67 67
     ) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 $paymentRenewal = $this->updateInvoicePayment(
160 160
                 $invoiceid,
161 161
                 $payment_method,
162
-             $payment_status,
162
+                $payment_status,
163 163
                 $payment_date,
164 164
                 $amount
165 165
             );
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 
218 218
                     return view(
219 219
                     'themes.default1.invoice.payment',
220
-                 compact(
221
-                     'invoice_status',
222
-                     'payment_status',
223
-                  'payment_method',
224
-                     'invoice_id',
225
-                     'domain',
226
-                     'invoice',
227
-                     'userid'
228
-                 )
220
+                    compact(
221
+                        'invoice_status',
222
+                        'payment_status',
223
+                    'payment_method',
224
+                        'invoice_id',
225
+                        'domain',
226
+                        'invoice',
227
+                        'userid'
228
+                    )
229 229
                 );
230 230
                 }
231 231
 
Please login to merge, or discard this patch.