Completed
Pull Request — development (#724)
by Ashutosh
18:55 queued 09:17
created
app/Http/Controllers/Payment/CurrencyController.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
                             return $model->name;
46 46
                         })
47 47
 
48
-                          ->addColumn('code', function ($model) {
49
-                              return $model->code;
50
-                          })
48
+                            ->addColumn('code', function ($model) {
49
+                                return $model->code;
50
+                            })
51 51
 
52
-                          ->addColumn('symbol', function ($model) {
53
-                              return $model->symbol;
54
-                          })
52
+                            ->addColumn('symbol', function ($model) {
53
+                                return $model->symbol;
54
+                            })
55 55
 
56
-                          ->addColumn('dashboard', function ($model) {
57
-                              if ($model->status == 1) {
58
-                                  $showButton = $this->getButtonColor($model->id);
56
+                            ->addColumn('dashboard', function ($model) {
57
+                                if ($model->status == 1) {
58
+                                    $showButton = $this->getButtonColor($model->id);
59 59
 
60
-                                  return $showButton;
61
-                              } else {
62
-                                  return  '<a class="btn btn-sm btn-primary btn-xs disabled"><i class="fa fa-eye"
60
+                                    return $showButton;
61
+                                } else {
62
+                                    return  '<a class="btn btn-sm btn-primary btn-xs disabled"><i class="fa fa-eye"
63 63
                                 style="color:white;"> </i>&nbsp;&nbsp;Show on Dashboard</a>';
64
-                              }
65
-                          })
64
+                                }
65
+                            })
66 66
 
67 67
                         ->addColumn('status', function ($model) {
68 68
                             if ($model->status == 1) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         $countryDetails = Country::where('country_id', $request->id)->select('currency_code', 'currency_symbol', 'currency_name')->first();
289 289
         $data = (['code'=> $countryDetails->currency_code,
290
-          'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
290
+            'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
291 291
 
292 292
         return $data;
293 293
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 
42 42
         return \DataTables::of($model)
43 43
 
44
-                        ->addColumn('name', function ($model) {
44
+                        ->addColumn('name', function($model) {
45 45
                             return $model->name;
46 46
                         })
47 47
 
48
-                          ->addColumn('code', function ($model) {
48
+                          ->addColumn('code', function($model) {
49 49
                               return $model->code;
50 50
                           })
51 51
 
52
-                          ->addColumn('symbol', function ($model) {
52
+                          ->addColumn('symbol', function($model) {
53 53
                               return $model->symbol;
54 54
                           })
55 55
 
56
-                          ->addColumn('dashboard', function ($model) {
56
+                          ->addColumn('dashboard', function($model) {
57 57
                               if ($model->status == 1) {
58 58
                                   $showButton = $this->getButtonColor($model->id);
59 59
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                               }
65 65
                           })
66 66
 
67
-                        ->addColumn('status', function ($model) {
67
+                        ->addColumn('status', function($model) {
68 68
                             if ($model->status == 1) {
69 69
                                 return'<label class="switch toggle_event_editing">
70 70
                             <input type="hidden" name="module_id" class="module_id" value="'.$model->id.'" >
Please login to merge, or discard this patch.
app/Http/Controllers/Github/GithubController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -279,7 +279,7 @@
 block discarded – undo
279 279
             StatusSetting::find(1)->update(['github_status'=>$status]);
280 280
             Github::find(1)->update(['username'=> $request->input('git_username'),
281 281
                 'password'                     => $request->input('git_password'), 'client_id'=>$request->input('git_client'),
282
-                 'client_secret'               => $request->input('git_secret'), ]);
282
+                    'client_secret'               => $request->input('git_secret'), ]);
283 283
 
284 284
             return ['message' => 'success', 'update'=>'Github Settings Updated'];
285 285
         } catch (Exception $ex) {
Please login to merge, or discard this patch.
app/Http/Controllers/User/ClientController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -115,18 +115,18 @@  discard block
 block discarded – undo
115 115
         );
116 116
 
117 117
         return\ DataTables::of($user->get())
118
-                         ->addColumn('checkbox', function ($model) {
118
+                         ->addColumn('checkbox', function($model) {
119 119
                              return "<input type='checkbox' class='user_checkbox' 
120 120
                             value=".$model->id.' name=select[] id=check>';
121 121
                          })
122
-                        ->addColumn('first_name', function ($model) {
122
+                        ->addColumn('first_name', function($model) {
123 123
                             return '<a href='.url('clients/'.$model->id).'>'
124 124
                             .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>';
125 125
                         })
126
-                         ->addColumn('email', function ($model) {
126
+                         ->addColumn('email', function($model) {
127 127
                              return $model->email;
128 128
                          })
129
-                          ->addColumn('created_at', function ($model) {
129
+                          ->addColumn('created_at', function($model) {
130 130
                               $ends = $model->created_at;
131 131
                               if ($ends) {
132 132
                                   $date1 = new DateTime($ends);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                               return $end;
139 139
                           })
140 140
                         // ->showColumns('email', 'created_at')
141
-                        ->addColumn('active', function ($model) {
141
+                        ->addColumn('active', function($model) {
142 142
                             if ($model->active == 1) {
143 143
                                 $email = "<span class='glyphicon glyphicon-envelope'
144 144
                                  style='color:green' title='verified email'></span>";
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
                             return $email.'&nbsp;&nbsp;'.$mobile;
158 158
                         })
159
-                        ->addColumn('action', function ($model) {
159
+                        ->addColumn('action', function($model) {
160 160
                             return '<a href='.url('clients/'.$model->id.'/edit')
161 161
                             ." class='btn btn-sm btn-primary btn-xs'>
162 162
                             <i class='fa fa-edit' style='color:white;'> </i>&nbsp;&nbsp;Edit</a>"
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                                     <i class='fa fa-eye' style='color:white;'> </i>&nbsp;&nbsp;View</a>";
166 166
                             // return 'hhhh';
167 167
                         })
168
-                        ->rawColumns(['checkbox', 'first_name', 'email',  'created_at', 'active', 'action'])
168
+                        ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action'])
169 169
                         ->make(true);
170 170
 
171 171
         // ->searchColumns('email', 'first_name')
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -116,28 +116,28 @@
 block discarded – undo
116 116
         );
117 117
 
118 118
         return\ DataTables::of($user->get())
119
-                         ->addColumn('checkbox', function ($model) {
120
-                             return "<input type='checkbox' class='user_checkbox' 
119
+                            ->addColumn('checkbox', function ($model) {
120
+                                return "<input type='checkbox' class='user_checkbox' 
121 121
                             value=".$model->id.' name=select[] id=check>';
122
-                         })
122
+                            })
123 123
                         ->addColumn('first_name', function ($model) {
124 124
                             return '<a href='.url('clients/'.$model->id).'>'
125 125
                             .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>';
126 126
                         })
127
-                         ->addColumn('email', function ($model) {
128
-                             return $model->email;
129
-                         })
130
-                          ->addColumn('created_at', function ($model) {
131
-                              $ends = $model->created_at;
132
-                              if ($ends) {
133
-                                  $date1 = new DateTime($ends);
134
-                                  $tz = \Auth::user()->timezone()->first()->name;
135
-                                  $date1->setTimezone(new DateTimeZone($tz));
136
-                                  $end = $date1->format('M j, Y, g:i a ');
137
-                              }
127
+                            ->addColumn('email', function ($model) {
128
+                                return $model->email;
129
+                            })
130
+                            ->addColumn('created_at', function ($model) {
131
+                                $ends = $model->created_at;
132
+                                if ($ends) {
133
+                                    $date1 = new DateTime($ends);
134
+                                    $tz = \Auth::user()->timezone()->first()->name;
135
+                                    $date1->setTimezone(new DateTimeZone($tz));
136
+                                    $end = $date1->format('M j, Y, g:i a ');
137
+                                }
138 138
 
139
-                              return $end;
140
-                          })
139
+                                return $end;
140
+                            })
141 141
                         // ->showColumns('email', 'created_at')
142 142
                         ->addColumn('active', function ($model) {
143 143
                             if ($model->active == 1) {
Please login to merge, or discard this patch.
app/Http/Controllers/User/AdvanceSearchController.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -150,9 +150,9 @@
 block discarded – undo
150 150
                 return \Response::json([]);
151 151
             }
152 152
             $users = User::where('email', 'LIKE', '%'.$term.'%')
153
-             ->orWhere('first_name', 'LIKE', '%'.$term.'%')
154
-             ->orWhere('last_name', 'LIKE', '%'.$term.'%')
155
-             ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get();
153
+                ->orWhere('first_name', 'LIKE', '%'.$term.'%')
154
+                ->orWhere('last_name', 'LIKE', '%'.$term.'%')
155
+                ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get();
156 156
             $formatted_tags = [];
157 157
 
158 158
             foreach ($users as $user) {
Please login to merge, or discard this patch.
app/Http/Controllers/Common/BaseMailChimpController.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
             }
51 51
             if ($interestGroupIdForNo && $productGroupId) {
52 52
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
53
-                 'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true],
54
-                  ]);
53
+                    'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true],
54
+                    ]);
55 55
             //refer to https://us7.api.mailchimp.com/playground
56 56
             } elseif ($interestGroupIdForNo && $productGroupId == null) {
57 57
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
58
-                 'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false],
59
-                  ]);
58
+                    'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false],
59
+                    ]);
60 60
             //refer to https://us7.api.mailchimp.com/playground
61 61
             } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) {
62 62
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
63
-                 'interests'         => [$productGroupId =>true],
64
-                  ]);
63
+                    'interests'         => [$productGroupId =>true],
64
+                    ]);
65 65
             }
66 66
         } catch (Exception $ex) {
67 67
             $exe = json_decode($ex->getMessage(), true);
@@ -85,18 +85,18 @@  discard block
 block discarded – undo
85 85
             }
86 86
             if ($interestGroupIdForNo && $productGroupId) {
87 87
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
88
-                 'interests'         => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true],
89
-                 //refer to https://us7.api.mailchimp.com/playground
90
-                 ]);
88
+                    'interests'         => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true],
89
+                    //refer to https://us7.api.mailchimp.com/playground
90
+                    ]);
91 91
             } elseif ($interestGroupIdForNo && $productGroupId == null) {
92 92
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
93
-                 'interests'         => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true],
94
-                  ]);
93
+                    'interests'         => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true],
94
+                    ]);
95 95
             //refer to https://us7.api.mailchimp.com/playground
96 96
             } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) {
97 97
                 $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
98
-                 'interests'         => [$productGroupId =>true],
99
-                  ]);
98
+                    'interests'         => [$productGroupId =>true],
99
+                    ]);
100 100
             }
101 101
             //refer to https://us7.api.mailchimp.com/playground
102 102
         } catch (Exception $ex) {
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 
115 115
             return\ DataTables::of($new_product)
116 116
 
117
-                            ->addColumn('checkbox', function ($model) {
117
+                            ->addColumn('checkbox', function($model) {
118 118
                                 return "<input type='checkbox' class='product_checkbox' 
119 119
                                 value=".$model->id.' name=select[] id=check>';
120 120
                             })
121
-                            ->addColumn('name', function ($model) {
121
+                            ->addColumn('name', function($model) {
122 122
                                 return ucfirst($model->name);
123 123
                             })
124
-                              ->addColumn('image', function ($model) {
124
+                              ->addColumn('image', function($model) {
125 125
                                   // return $model->image;
126 126
                                   return "<img src= '$model->image' + height=\"80\"/>";
127 127
                               })
128
-                            ->addColumn('type', function ($model) {
128
+                            ->addColumn('type', function($model) {
129 129
                                 if ($this->type->where('id', $model->type)->first()) {
130 130
                                     return $this->type->where('id', $model->type)->first()->name;
131 131
                                 } else {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                                 }
134 134
                             })
135 135
 
136
-                            ->addColumn('group', function ($model) {
136
+                            ->addColumn('group', function($model) {
137 137
                                 if ($this->group->where('id', $model->group)->first()) {
138 138
                                     return $this->group->where('id', $model->group)->first()->name;
139 139
                                 } else {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                                 }
142 142
                             })
143 143
 
144
-                            ->addColumn('Action', function ($model) {
144
+                            ->addColumn('Action', function($model) {
145 145
                                 $permissions = LicensePermissionsController::getPermissionsForProduct($model->id);
146 146
                                 $url = '';
147 147
                                 if ($permissions['downloadPermission'] == 1) {
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
                             ->addColumn('name', function ($model) {
126 126
                                 return ucfirst($model->name);
127 127
                             })
128
-                              ->addColumn('image', function ($model) {
129
-                                  // return $model->image;
130
-                                  return "<img src= '$model->image' + height=\"80\"/>";
131
-                              })
128
+                                ->addColumn('image', function ($model) {
129
+                                    // return $model->image;
130
+                                    return "<img src= '$model->image' + height=\"80\"/>";
131
+                                })
132 132
                             ->addColumn('type', function ($model) {
133 133
                                 if ($this->type->where('id', $model->type)->first()) {
134 134
                                     return $this->type->where('id', $model->type)->first()->name;
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
         $this->validate($request, [
175 175
         'producttitle' => 'required',
176 176
         'version'      => 'required',
177
-       'filename'      => 'required',
178
-       ],
179
-       ['filename.required' => 'Please Uplaod A file',
177
+        'filename'      => 'required',
178
+        ],
179
+        ['filename.required' => 'Please Uplaod A file',
180 180
         ]);
181 181
 
182 182
         try {
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -190,7 +190,8 @@  discard block
 block discarded – undo
190 190
             $this->product_upload->save();
191 191
             $this->product->where('id', $product_id->id)->update(['version'=>$request->input('version')]);
192 192
             $autoUpdateStatus = StatusSetting::pluck('update_settings')->first();
193
-            if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
193
+            if ($autoUpdateStatus == 1) {
194
+//If License Setting Status is on,Add Product to the License Manager
194 195
                 $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
195 196
                 $addProductToAutoUpdate = $updateClassObj->addNewVersion($product_id->id, $request->input('version'), $request->input('filename'), '1');
196 197
             }
@@ -280,7 +281,8 @@  discard block
 block discarded – undo
280 281
 
281 282
         try {
282 283
             $licenseStatus = StatusSetting::pluck('license_status')->first();
283
-            if ($licenseStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
284
+            if ($licenseStatus == 1) {
285
+//If License Setting Status is on,Add Product to the License Manager
284 286
                 $addProductToLicensing = $this->licensing->addNewProduct($input['name'], $input['product_sku']);
285 287
             }
286 288
             $licenseCont = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
Please login to merge, or discard this patch.
app/Http/Controllers/Common/MailChimpController.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         try {
59 59
             $merge_fields = $this->field($email);
60 60
             $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No
61
-              $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
61
+                $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
62 62
             $result = $this->mailchimp->post("lists/$this->list_id/members", [
63 63
                 'status'        => $this->mailchimp_set->subscribe_status,
64 64
                 'email_address' => $email,
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $country = Country::where('country_code_char2', $user->country)->pluck('nicename')->first();
115 115
             if ($user) {
116 116
                 $fields = ['first_name', 'last_name', 'company', 'mobile',
117
-                 'address', 'town', 'country', 'state', 'zip', 'active', 'role', 'source', ];
117
+                    'address', 'town', 'country', 'state', 'zip', 'active', 'role', 'source', ];
118 118
                 $relation = $this->relation;
119 119
                 $merge_fields = [];
120 120
                 foreach ($fields as $field) {
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 
242 242
             $this->addProductInterestFieldsToAgora(); //add all the fields in Product Section of Groups to the db
243 243
             $group_fields = $this->groups->where('list_id', $this->list_id)
244
-          ->select('category_name', 'category_option_id', 'category_id')->get()->toArray();
244
+            ->select('category_name', 'category_option_id', 'category_id')->get()->toArray();
245 245
             // dd($group_fields[0]);
246 246
             $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0)
247
-          ->select('agora_product_id', 'mailchimp_group_cat_id')
248
-          ->orderBy('id', 'asc')->get()->toArray();
247
+            ->select('agora_product_id', 'mailchimp_group_cat_id')
248
+            ->orderBy('id', 'asc')->get()->toArray();
249 249
             $productList = [];
250 250
             $categoryList = [];
251 251
             if (count($relations) != 0) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             MailchimpGroupAgoraRelation::where('id', '!=', 0)->delete();
325 325
             foreach ($request->row as $key => $value) {
326 326
                 MailchimpGroupAgoraRelation::create(['agora_product_id'=> $value[0],
327
-             'mailchimp_group_cat_id'                                  => $value[1], ]);
327
+                'mailchimp_group_cat_id'                                  => $value[1], ]);
328 328
             }
329 329
 
330 330
             return redirect()->back()->with('success', \Lang::get('message.updated-successfully'));
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ExtendedBaseCartController.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,18 +135,21 @@
 block discarded – undo
135 135
             if ($this->checkPlanSession() === true) {
136 136
                 $planid = Session::get('plan');
137 137
             }
138
-            if (!$planid) {//When Product Is Added from Cart
138
+            if (!$planid) {
139
+//When Product Is Added from Cart
139 140
                 $planid = Plan::where('product', $productid)->pluck('id')->first();
140 141
             }
141 142
             $plan = Plan::where('id', $planid)->where('product', $productid)->first();
142
-            if ($plan) { //Get the Total Plan Cost if the Plan Exists For a Product
143
+            if ($plan) {
144
+//Get the Total Plan Cost if the Plan Exists For a Product
143 145
                 $months = 1;
144 146
                 $cont = new CartController();
145 147
                 $currency = $cont->currency($userid);
146 148
                 $product = Product::find($productid);
147 149
                 $days = $plan->periods->pluck('days')->first();
148 150
                 $price = ($product->planRelation->find($planid)->planPrice->where('currency', $currency['currency'])->first()->add_price);
149
-                if ($days) { //If Period Is defined for a Particular Plan ie no. of Days Generated
151
+                if ($days) {
152
+//If Period Is defined for a Particular Plan ie no. of Days Generated
150 153
                     $months = $days >= '365' ? $days / 30 / 12 : $days / 30;
151 154
                 }
152 155
                 $finalPrice = str_replace(',', '', $price);
Please login to merge, or discard this patch.
app/Http/Controllers/Order/OrderController.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -150,36 +150,36 @@
 block discarded – undo
150 150
                             return $url;
151 151
                         })
152 152
 
153
-                         ->filterColumn('created_at', function ($query, $keyword) {
154
-                             $sql = 'created_at like ?';
155
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
156
-                         })
157
-
158
-                          ->filterColumn('client', function ($query, $keyword) {
159
-                              $sql = 'client like ?';
160
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
161
-                          })
162
-
163
-                           ->filterColumn('number', function ($query, $keyword) {
164
-                               $sql = 'number like ?';
165
-                               $query->whereRaw($sql, ["%{$keyword}%"]);
166
-                           })
153
+                            ->filterColumn('created_at', function ($query, $keyword) {
154
+                                $sql = 'created_at like ?';
155
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
156
+                            })
157
+
158
+                            ->filterColumn('client', function ($query, $keyword) {
159
+                                $sql = 'client like ?';
160
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
161
+                            })
162
+
163
+                            ->filterColumn('number', function ($query, $keyword) {
164
+                                $sql = 'number like ?';
165
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
166
+                            })
167 167
                             ->filterColumn('price_override', function ($query, $keyword) {
168 168
                                 $sql = 'price_override like ?';
169 169
                                 $query->whereRaw($sql, ["%{$keyword}%"]);
170 170
                             })
171
-                             ->filterColumn('order_status', function ($query, $keyword) {
172
-                                 $sql = 'order_status like ?';
173
-                                 $query->whereRaw($sql, ["%{$keyword}%"]);
174
-                             })
175
-
176
-                              ->filterColumn('update_ends_at', function ($query, $keyword) {
177
-                                  $sql = 'update_ends_at like ?';
178
-                                  $query->whereRaw($sql, ["%{$keyword}%"]);
179
-                              })
180
-
181
-                         ->rawColumns(['checkbox', 'date', 'client', 'number',
182
-                          'price_override', 'order_status', 'productname', 'update_ends_at', 'action', ])
171
+                                ->filterColumn('order_status', function ($query, $keyword) {
172
+                                    $sql = 'order_status like ?';
173
+                                    $query->whereRaw($sql, ["%{$keyword}%"]);
174
+                                })
175
+
176
+                                ->filterColumn('update_ends_at', function ($query, $keyword) {
177
+                                    $sql = 'update_ends_at like ?';
178
+                                    $query->whereRaw($sql, ["%{$keyword}%"]);
179
+                                })
180
+
181
+                            ->rawColumns(['checkbox', 'date', 'client', 'number',
182
+                            'price_override', 'order_status', 'productname', 'update_ends_at', 'action', ])
183 183
                         ->make(true);
184 184
     }
185 185
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
         return \DataTables::of($query->take(50))
106 106
                         ->setTotalRecords($query->count())
107
-                        ->addColumn('checkbox', function ($model) {
107
+                        ->addColumn('checkbox', function($model) {
108 108
                             return "<input type='checkbox' class='order_checkbox' value=".
109 109
                             $model->id.' name=select[] id=check>';
110 110
                         })
111
-                        ->addColumn('date', function ($model) {
111
+                        ->addColumn('date', function($model) {
112 112
                             $date = $model->created_at;
113 113
 
114 114
                             return "<span style='display:none'>$model->id</span>".$date;
115 115
                         })
116
-                        ->addColumn('client', function ($model) {
116
+                        ->addColumn('client', function($model) {
117 117
                             $user = $this->user->where('id', $model->client)->first();
118 118
                             $first = $user->first_name;
119 119
                             $last = $user->last_name;
@@ -121,28 +121,28 @@  discard block
 block discarded – undo
121 121
 
122 122
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>';
123 123
                         })
124
-                        ->addColumn('productname', function ($model) {
124
+                        ->addColumn('productname', function($model) {
125 125
                             $productid = ($model->product);
126 126
                             $productName = Product::where('id', $productid)->pluck('name')->first();
127 127
 
128 128
                             return $productName;
129 129
                         })
130
-                        ->addColumn('number', function ($model) {
130
+                        ->addColumn('number', function($model) {
131 131
                             return ucfirst($model->number);
132 132
                         })
133
-                        ->addColumn('price_override', function ($model) {
133
+                        ->addColumn('price_override', function($model) {
134 134
                             return ucfirst($model->price_override);
135 135
                         })
136
-                        ->addColumn('order_status', function ($model) {
136
+                        ->addColumn('order_status', function($model) {
137 137
                             return ucfirst($model->order_status);
138 138
                         })
139 139
                         // ->showColumns('number', 'price_override', 'order_status')
140
-                        ->addColumn('update_ends_at', function ($model) {
140
+                        ->addColumn('update_ends_at', function($model) {
141 141
                             $end = $this->getEndDate($model);
142 142
 
143 143
                             return $end;
144 144
                         })
145
-                        ->addColumn('action', function ($model) {
145
+                        ->addColumn('action', function($model) {
146 146
                             $sub = $model->subscription()->first();
147 147
                             $status = $this->checkInvoiceStatusByOrderId($model->id);
148 148
                             $url = $this->getUrl($model, $status, $sub);
@@ -150,30 +150,30 @@  discard block
 block discarded – undo
150 150
                             return $url;
151 151
                         })
152 152
 
153
-                         ->filterColumn('created_at', function ($query, $keyword) {
153
+                         ->filterColumn('created_at', function($query, $keyword) {
154 154
                              $sql = 'created_at like ?';
155 155
                              $query->whereRaw($sql, ["%{$keyword}%"]);
156 156
                          })
157 157
 
158
-                          ->filterColumn('client', function ($query, $keyword) {
158
+                          ->filterColumn('client', function($query, $keyword) {
159 159
                               $sql = 'client like ?';
160 160
                               $query->whereRaw($sql, ["%{$keyword}%"]);
161 161
                           })
162 162
 
163
-                           ->filterColumn('number', function ($query, $keyword) {
163
+                           ->filterColumn('number', function($query, $keyword) {
164 164
                                $sql = 'number like ?';
165 165
                                $query->whereRaw($sql, ["%{$keyword}%"]);
166 166
                            })
167
-                            ->filterColumn('price_override', function ($query, $keyword) {
167
+                            ->filterColumn('price_override', function($query, $keyword) {
168 168
                                 $sql = 'price_override like ?';
169 169
                                 $query->whereRaw($sql, ["%{$keyword}%"]);
170 170
                             })
171
-                             ->filterColumn('order_status', function ($query, $keyword) {
171
+                             ->filterColumn('order_status', function($query, $keyword) {
172 172
                                  $sql = 'order_status like ?';
173 173
                                  $query->whereRaw($sql, ["%{$keyword}%"]);
174 174
                              })
175 175
 
176
-                              ->filterColumn('update_ends_at', function ($query, $keyword) {
176
+                              ->filterColumn('update_ends_at', function($query, $keyword) {
177 177
                                   $sql = 'update_ends_at like ?';
178 178
                                   $query->whereRaw($sql, ["%{$keyword}%"]);
179 179
                               })
Please login to merge, or discard this patch.