@@ -46,23 +46,23 @@ discard block |
||
| 46 | 46 | //dd($user); |
| 47 | 47 | |
| 48 | 48 | return \Datatable::query($user) |
| 49 | - ->addColumn('#', function ($model) { |
|
| 49 | + ->addColumn('#', function($model) { |
|
| 50 | 50 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 51 | 51 | }) |
| 52 | - ->addColumn('first_name', function ($model) { |
|
| 52 | + ->addColumn('first_name', function($model) { |
|
| 53 | 53 | return '<a href='.url('clients/'.$model->id).'>'.ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 54 | 54 | }) |
| 55 | 55 | |
| 56 | 56 | ->showColumns('email', 'created_at') |
| 57 | 57 | |
| 58 | - ->addColumn('active', function ($model) { |
|
| 58 | + ->addColumn('active', function($model) { |
|
| 59 | 59 | if ($model->active == 1) { |
| 60 | 60 | return "<span style='color:green'>Activated</span>"; |
| 61 | 61 | } else { |
| 62 | 62 | return "<span style='color:red'>Not activated</span>"; |
| 63 | 63 | } |
| 64 | 64 | }) |
| 65 | - ->addColumn('action', function ($model) { |
|
| 65 | + ->addColumn('action', function($model) { |
|
| 66 | 66 | return '<a href='.url('clients/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>" |
| 67 | 67 | .' <a href='.url('clients/'.$model->id)." class='btn btn-sm btn-primary'>View</a>"; |
| 68 | 68 | }) |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $token = str_random(40); |
| 100 | 100 | $this->activate->create(['email' => $user->email, 'token' => $token]); |
| 101 | 101 | |
| 102 | - \Mail::send('emails.welcome', ['token' => $token, 'email' => $user->email, 'pass' => $str], function ($message) use ($user) { |
|
| 102 | + \Mail::send('emails.welcome', ['token' => $token, 'email' => $user->email, 'pass' => $str], function($message) use ($user) { |
|
| 103 | 103 | $message->to($user->email, $user->first_name)->subject('Welcome!'); |
| 104 | 104 | }); |
| 105 | 105 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | try { |
| 119 | 119 | $invoice = new Invoice(); |
| 120 | 120 | $order = new Order(); |
| 121 | - $invoices = $invoice->where('user_id', $id)->orderBy('created_at','desc')->get(); |
|
| 121 | + $invoices = $invoice->where('user_id', $id)->orderBy('created_at', 'desc')->get(); |
|
| 122 | 122 | $client = $this->user->where('id', $id)->first(); |
| 123 | 123 | $orders = $order->where('client', $id)->get(); |
| 124 | 124 | //dd($client); |
@@ -54,18 +54,18 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | return \Datatable::collection(new Collection($plugins)) |
| 56 | 56 | ->searchColumns('name') |
| 57 | - ->addColumn('name', function ($model) { |
|
| 57 | + ->addColumn('name', function($model) { |
|
| 58 | 58 | if (array_has($model, 'path')) { |
| 59 | 59 | if ($model['status'] == 0) { |
| 60 | - $activate = '<a href=' . url('plugin/status/' . $model['path']) . '>Activate</a>'; |
|
| 60 | + $activate = '<a href='.url('plugin/status/'.$model['path']).'>Activate</a>'; |
|
| 61 | 61 | $settings = ' '; |
| 62 | 62 | } else { |
| 63 | - $settings = '<a href=' . url($model['settings']) . '>Settings</a> | '; |
|
| 64 | - $activate = '<a href=' . url('plugin/status/' . $model['path']) . '>Deactivate</a>'; |
|
| 63 | + $settings = '<a href='.url($model['settings']).'>Settings</a> | '; |
|
| 64 | + $activate = '<a href='.url('plugin/status/'.$model['path']).'>Deactivate</a>'; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $delete = '<a href= id=delete' . $model['path'] . ' data-toggle=modal data-target=#del' . $model['path'] . "><span style='color:red'>Delete</span></a>" |
|
| 68 | - . "<div class='modal fade' id=del" . $model['path'] . "> |
|
| 67 | + $delete = '<a href= id=delete'.$model['path'].' data-toggle=modal data-target=#del'.$model['path']."><span style='color:red'>Delete</span></a>" |
|
| 68 | + . "<div class='modal fade' id=del".$model['path']."> |
|
| 69 | 69 | <div class='modal-dialog'> |
| 70 | 70 | <div class=modal-content> |
| 71 | 71 | <div class=modal-header> |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | <div class=modal-body> |
| 75 | 75 | <p>Are you Sure ?</p> |
| 76 | 76 | <div class=modal-footer> |
| 77 | - <button type=button class='btn btn-default pull-left' data-dismiss=modal id=dismis>" . \Lang::get('lang.close') . '</button> |
|
| 78 | - <a href=' . url('plugin/delete/' . $model['path']) . "><button class='btn btn-danger'>Delete</button></a> |
|
| 77 | + <button type=button class='btn btn-default pull-left' data-dismiss=modal id=dismis>" . \Lang::get('lang.close').'</button> |
|
| 78 | + <a href=' . url('plugin/delete/'.$model['path'])."><button class='btn btn-danger'>Delete</button></a> |
|
| 79 | 79 | </div> |
| 80 | 80 | |
| 81 | 81 | |
@@ -83,23 +83,23 @@ discard block |
||
| 83 | 83 | </div> |
| 84 | 84 | </div> |
| 85 | 85 | </div>"; |
| 86 | - $action = '<br><br>' . $delete . ' | ' . $settings . $activate; |
|
| 86 | + $action = '<br><br>'.$delete.' | '.$settings.$activate; |
|
| 87 | 87 | } else { |
| 88 | 88 | $action = ''; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return ucfirst($model['name']) . $action; |
|
| 91 | + return ucfirst($model['name']).$action; |
|
| 92 | 92 | }) |
| 93 | - ->addColumn('description', function ($model) { |
|
| 93 | + ->addColumn('description', function($model) { |
|
| 94 | 94 | return ucfirst($model['description']); |
| 95 | 95 | }) |
| 96 | - ->addColumn('author', function ($model) { |
|
| 96 | + ->addColumn('author', function($model) { |
|
| 97 | 97 | return ucfirst($model['author']); |
| 98 | 98 | }) |
| 99 | - ->addColumn('website', function ($model) { |
|
| 100 | - return '<a href=' . $model['website'] . ' target=_blank>' . $model['website'] . '</a>'; |
|
| 99 | + ->addColumn('website', function($model) { |
|
| 100 | + return '<a href='.$model['website'].' target=_blank>'.$model['website'].'</a>'; |
|
| 101 | 101 | }) |
| 102 | - ->addColumn('version', function ($model) { |
|
| 102 | + ->addColumn('version', function($model) { |
|
| 103 | 103 | return $model['version']; |
| 104 | 104 | }) |
| 105 | 105 | ->make(); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @return type |
| 112 | 112 | */ |
| 113 | 113 | public function ReadPlugins() { |
| 114 | - $dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins'; |
|
| 114 | + $dir = app_path().DIRECTORY_SEPARATOR.'Plugins'; |
|
| 115 | 115 | $plugins = array_diff(scandir($dir), ['.', '..']); |
| 116 | 116 | |
| 117 | 117 | return $plugins; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $plug = new Plugin(); |
| 130 | 130 | $file = $request->file('plugin'); |
| 131 | 131 | //dd($file); |
| 132 | - $destination = app_path() . DIRECTORY_SEPARATOR . 'Plugins'; |
|
| 132 | + $destination = app_path().DIRECTORY_SEPARATOR.'Plugins'; |
|
| 133 | 133 | $zipfile = $file->getRealPath(); |
| 134 | 134 | /* |
| 135 | 135 | * get the file name and remove .zip |
@@ -138,30 +138,30 @@ discard block |
||
| 138 | 138 | $filename2 = str_replace('.zip', '', $filename2); |
| 139 | 139 | $filename1 = ucfirst($file->getClientOriginalName()); |
| 140 | 140 | $filename = str_replace('.zip', '', $filename1); |
| 141 | - mkdir($destination . DIRECTORY_SEPARATOR . $filename); |
|
| 141 | + mkdir($destination.DIRECTORY_SEPARATOR.$filename); |
|
| 142 | 142 | /* |
| 143 | 143 | * extract the zip file using zipper |
| 144 | 144 | */ |
| 145 | - \Zipper::make($zipfile)->folder($filename2)->extractTo($destination . DIRECTORY_SEPARATOR . $filename); |
|
| 145 | + \Zipper::make($zipfile)->folder($filename2)->extractTo($destination.DIRECTORY_SEPARATOR.$filename); |
|
| 146 | 146 | |
| 147 | - $file = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . $filename; // Plugin file path |
|
| 147 | + $file = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$filename; // Plugin file path |
|
| 148 | 148 | |
| 149 | 149 | if (file_exists($file)) { |
| 150 | - $seviceporvider = $file . DIRECTORY_SEPARATOR . 'ServiceProvider.php'; |
|
| 151 | - $config = $file . DIRECTORY_SEPARATOR . 'config.php'; |
|
| 150 | + $seviceporvider = $file.DIRECTORY_SEPARATOR.'ServiceProvider.php'; |
|
| 151 | + $config = $file.DIRECTORY_SEPARATOR.'config.php'; |
|
| 152 | 152 | if (file_exists($seviceporvider) && file_exists($config)) { |
| 153 | 153 | /* |
| 154 | 154 | * move to faveo config |
| 155 | 155 | */ |
| 156 | - $faveoconfig = config_path() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $filename . '.php'; |
|
| 156 | + $faveoconfig = config_path().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$filename.'.php'; |
|
| 157 | 157 | if ($faveoconfig) { |
| 158 | 158 | |
| 159 | 159 | //copy($config, $faveoconfig); |
| 160 | 160 | /* |
| 161 | 161 | * write provider list in app.php line 128 |
| 162 | 162 | */ |
| 163 | - $app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php'; |
|
| 164 | - $str = "\n\n\t\t\t'App\\Plugins\\$filename" . "\\ServiceProvider',"; |
|
| 163 | + $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
|
| 164 | + $str = "\n\n\t\t\t'App\\Plugins\\$filename"."\\ServiceProvider',"; |
|
| 165 | 165 | $line_i_am_looking_for = 102; |
| 166 | 166 | $lines = file($app, FILE_IGNORE_NEW_LINES); |
| 167 | 167 | $lines[$line_i_am_looking_for] = $str; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | $this->deleteDirectory($file); |
| 177 | 177 | |
| 178 | - return redirect()->back()->with('fails', 'Their is no ' . $file); |
|
| 178 | + return redirect()->back()->with('fails', 'Their is no '.$file); |
|
| 179 | 179 | } |
| 180 | 180 | } else { |
| 181 | 181 | /* |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | $this->deleteDirectory($file); |
| 185 | 185 | |
| 186 | - return redirect()->back()->with('fails', 'Their is no <b>config.php or ServiceProvider.php</b> ' . $file); |
|
| 186 | + return redirect()->back()->with('fails', 'Their is no <b>config.php or ServiceProvider.php</b> '.$file); |
|
| 187 | 187 | } |
| 188 | 188 | } else { |
| 189 | 189 | /* |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | $this->deleteDirectory($file); |
| 193 | 193 | |
| 194 | - return redirect()->back()->with('fails', '<b>Plugin File Path is not exist</b> ' . $file); |
|
| 194 | + return redirect()->back()->with('fails', '<b>Plugin File Path is not exist</b> '.$file); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | if ($item == '.' || $item == '..') { |
| 214 | 214 | continue; |
| 215 | 215 | } |
| 216 | - chmod($dir . DIRECTORY_SEPARATOR . $item, 0777); |
|
| 217 | - if (!$this->deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { |
|
| 216 | + chmod($dir.DIRECTORY_SEPARATOR.$item, 0777); |
|
| 217 | + if (!$this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) { |
|
| 218 | 218 | return false; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | public function ReadConfigs() { |
| 227 | - $dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR; |
|
| 227 | + $dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR; |
|
| 228 | 228 | $directories = scandir($dir); |
| 229 | 229 | $files = []; |
| 230 | 230 | foreach ($directories as $key => $file) { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | continue; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - if (is_dir($dir . DIRECTORY_SEPARATOR . $file)) { |
|
| 235 | + if (is_dir($dir.DIRECTORY_SEPARATOR.$file)) { |
|
| 236 | 236 | $files[$key] = $file; |
| 237 | 237 | } |
| 238 | 238 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $plugins = []; |
| 242 | 242 | if (count($files) > 0) { |
| 243 | 243 | foreach ($files as $key => $file) { |
| 244 | - $plugin = $dir . $file; |
|
| 244 | + $plugin = $dir.$file; |
|
| 245 | 245 | $plugins[$key] = array_diff(scandir($plugin), ['.', '..', 'ServiceProvider.php']); |
| 246 | 246 | $plugins[$key]['file'] = $plugin; |
| 247 | 247 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if ($dh = opendir($dir)) { |
| 252 | 252 | while (($file = readdir($dh)) !== false) { |
| 253 | 253 | if ($file == 'config.php') { |
| 254 | - $config[] = $dir . DIRECTORY_SEPARATOR . $file; |
|
| 254 | + $config[] = $dir.DIRECTORY_SEPARATOR.$file; |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | closedir($dh); |
@@ -301,13 +301,13 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | public function deletePlugin($slug) { |
| 304 | - $dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . $slug; |
|
| 304 | + $dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$slug; |
|
| 305 | 305 | $this->deleteDirectory($dir); |
| 306 | 306 | /* |
| 307 | 307 | * remove service provider from app.php |
| 308 | 308 | */ |
| 309 | - $str = "'App\\Plugins\\$slug" . "\\ServiceProvider',"; |
|
| 310 | - $path_to_file = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php'; |
|
| 309 | + $str = "'App\\Plugins\\$slug"."\\ServiceProvider',"; |
|
| 310 | + $path_to_file = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
|
| 311 | 311 | $file_contents = file_get_contents($path_to_file); |
| 312 | 312 | $file_contents = str_replace($str, '//', $file_contents); |
| 313 | 313 | file_put_contents($path_to_file, $file_contents); |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | $plugs = new Plugin(); |
| 325 | 325 | $plug = $plugs->where('name', $slug)->first(); |
| 326 | 326 | if (!$plug) { |
| 327 | - $app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php'; |
|
| 328 | - $str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',"; |
|
| 327 | + $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
|
| 328 | + $str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',"; |
|
| 329 | 329 | $line_i_am_looking_for = 102; |
| 330 | 330 | $lines = file($app, FILE_IGNORE_NEW_LINES); |
| 331 | 331 | $lines[$line_i_am_looking_for] = $str; |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | if ($status == 0) { |
| 339 | 339 | $plug->status = 1; |
| 340 | 340 | |
| 341 | - $app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php'; |
|
| 342 | - $str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',"; |
|
| 341 | + $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
|
| 342 | + $str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',"; |
|
| 343 | 343 | $line_i_am_looking_for = 102; |
| 344 | 344 | $lines = file($app, FILE_IGNORE_NEW_LINES); |
| 345 | 345 | $lines[$line_i_am_looking_for] = $str; |
@@ -350,8 +350,8 @@ discard block |
||
| 350 | 350 | /* |
| 351 | 351 | * remove service provider from app.php |
| 352 | 352 | */ |
| 353 | - $str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',"; |
|
| 354 | - $path_to_file = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php'; |
|
| 353 | + $str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',"; |
|
| 354 | + $path_to_file = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; |
|
| 355 | 355 | |
| 356 | 356 | $file_contents = file_get_contents($path_to_file); |
| 357 | 357 | $file_contents = str_replace($str, '//', $file_contents); |