@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | if (\Config::get('lfm.allow_multi_user') === true) { |
13 | 13 | $slug = \Config::get('lfm.user_field'); |
14 | 14 | |
15 | - $new_working_dir = '/' . CRUDBooster::myId(); |
|
15 | + $new_working_dir = '/'.CRUDBooster::myId(); |
|
16 | 16 | |
17 | 17 | $previous_dir = $request->input('working_dir'); |
18 | 18 | |
19 | 19 | if ($previous_dir == null) { |
20 | 20 | $request->merge(['working_dir' => $new_working_dir]); |
21 | - } elseif (! $this->validDir($previous_dir)) { |
|
21 | + } elseif (!$this->validDir($previous_dir)) { |
|
22 | 22 | $request->replace(['working_dir' => $new_working_dir]); |
23 | 23 | } |
24 | 24 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | private function validDir($previous_dir) |
30 | 30 | { |
31 | - if (starts_with($previous_dir, '/' . \Config::get('lfm.shared_folder_name'))) { |
|
31 | + if (starts_with($previous_dir, '/'.\Config::get('lfm.shared_folder_name'))) { |
|
32 | 32 | return true; |
33 | 33 | } |
34 | 34 | |
35 | - if (starts_with($previous_dir, '/' . CRUDBooster::myId() )) { |
|
35 | + if (starts_with($previous_dir, '/'.CRUDBooster::myId())) { |
|
36 | 36 | return true; |
37 | 37 | } |
38 | 38 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | 'use_package_routes' => true, |
11 | 11 | |
12 | 12 | // For laravel 5.2, please set to ['web', 'auth'] |
13 | - 'middlewares' => ['web','\crocodicstudio\crudbooster\middlewares\CBBackend'], |
|
13 | + 'middlewares' => ['web', '\crocodicstudio\crudbooster\middlewares\CBBackend'], |
|
14 | 14 | |
15 | 15 | // Add prefix for routes |
16 | 16 | 'prefix' => 'laravel-filemanager', |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $working_dir = '/'; |
55 | 55 | $working_dir .= (Config::get('lfm.allow_multi_user')) ? $this->getUserSlug() : Config::get('lfm.shared_folder_name'); |
56 | 56 | |
57 | - $extension_not_found = ! extension_loaded('gd') && ! extension_loaded('imagick'); |
|
57 | + $extension_not_found = !extension_loaded('gd') && !extension_loaded('imagick'); |
|
58 | 58 | |
59 | 59 | return view('laravel-filemanager::index') |
60 | 60 | ->with('working_dir', $working_dir) |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | private function formatLocation($location, $type = null, $get_thumb = false) |
86 | 86 | { |
87 | 87 | if ($type === 'share') { |
88 | - return $location . Config::get('lfm.shared_folder_name'); |
|
88 | + return $location.Config::get('lfm.shared_folder_name'); |
|
89 | 89 | } elseif ($type === 'user') { |
90 | - return $location . $this->getUserSlug(); |
|
90 | + return $location.$this->getUserSlug(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $working_dir = Input::get('working_dir'); |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | |
107 | 107 | //if user is inside thumbs folder there is no need |
108 | 108 | // to add thumbs substring to the end of $location |
109 | - $in_thumb_folder = preg_match('/'.Config::get('lfm.thumb_folder_name').'$/i',$working_dir); |
|
109 | + $in_thumb_folder = preg_match('/'.Config::get('lfm.thumb_folder_name').'$/i', $working_dir); |
|
110 | 110 | |
111 | 111 | if ($type === 'thumb' && !$in_thumb_folder) { |
112 | - $location .= Config::get('lfm.thumb_folder_name') . '/'; |
|
112 | + $location .= Config::get('lfm.thumb_folder_name').'/'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return $location; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | public function getPath($type = null, $get_thumb = false) |
131 | 131 | { |
132 | - $path = base_path() . '/' . $this->file_location; |
|
132 | + $path = base_path().'/'.$this->file_location; |
|
133 | 133 | |
134 | 134 | $path = $this->formatLocation($path, $type); |
135 | 135 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $url = $this->formatLocation($url, $type); |
145 | 145 | |
146 | - $url = str_replace('\\','/',$url); |
|
146 | + $url = str_replace('\\', '/', $url); |
|
147 | 147 | |
148 | 148 | return $url; |
149 | 149 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | $arr_dir = explode('/', $lfm_file_path); |
178 | 178 | $arr_filename['short'] = end($arr_dir); |
179 | - $arr_filename['long'] = '/' . $lfm_file_path; |
|
179 | + $arr_filename['long'] = '/'.$lfm_file_path; |
|
180 | 180 | |
181 | 181 | return $arr_filename; |
182 | 182 | } |
@@ -54,16 +54,16 @@ discard block |
||
54 | 54 | __DIR__.'/userfiles/views/vendor/crudbooster/type_components/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'), |
55 | 55 | ], 'cb_type_components'); |
56 | 56 | |
57 | - if (! file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
57 | + if (!file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
58 | 58 | $this->publishes([__DIR__.'/userfiles/controllers/CBHook.php' => app_path('Http/Controllers/CBHook.php')], 'CBHook'); |
59 | 59 | } |
60 | 60 | |
61 | - if (! file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
61 | + if (!file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
62 | 62 | $this->publishes([__DIR__.'/userfiles/controllers/AdminUsersController.php' => app_path('Http/Controllers/AdminUsersController.php')], 'cb_user_controller'); |
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->defineValidationRules(); |
66 | - $this->loadRoutesFrom( __DIR__.'/routes.php'); |
|
66 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
79 | 79 | |
80 | - $this->app->singleton('crudbooster', function () { |
|
80 | + $this->app->singleton('crudbooster', function() { |
|
81 | 81 | return true; |
82 | 82 | }); |
83 | 83 | |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | |
119 | 119 | private function registerCrudboosterCommand() |
120 | 120 | { |
121 | - $this->app->singleton('crudboosterinstall', function () { |
|
121 | + $this->app->singleton('crudboosterinstall', function() { |
|
122 | 122 | return new CrudboosterInstallationCommand; |
123 | 123 | }); |
124 | 124 | |
125 | - $this->app->singleton('crudboosterupdate', function () { |
|
125 | + $this->app->singleton('crudboosterupdate', function() { |
|
126 | 126 | return new CrudboosterUpdateCommand; |
127 | 127 | }); |
128 | 128 | } |
129 | 129 | |
130 | 130 | private function defineValidationRules() |
131 | 131 | { |
132 | - \Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
132 | + \Validator::extend('alpha_spaces', function($attribute, $value) { |
|
133 | 133 | // This will only accept alpha and spaces. |
134 | 134 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
135 | 135 | return preg_match('/^[\pL\s]+$/u', $value); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | $namespace = '\crocodicstudio\crudbooster\controllers'; |
6 | 6 | /* ROUTER FOR UPLOADS */ |
7 | -Route::group(['middleware' => ['web'], 'namespace' => $namespace], function () { |
|
7 | +Route::group(['middleware' => ['web'], 'namespace' => $namespace], function() { |
|
8 | 8 | Route::get('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', ['uses' => 'FileController@getPreview', 'as' => 'fileControllerPreview']); |
9 | 9 | }); |
10 | 10 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | 'middleware' => ['web', CBBackend::class], |
14 | 14 | 'prefix' => cbAdminPath(), |
15 | 15 | 'namespace' => ctrlNamespace(), |
16 | -], function () { |
|
16 | +], function() { |
|
17 | 17 | CRUDBooster::routeController('users', 'AdminUsersController'); |
18 | 18 | try { |
19 | 19 | $modules = DB::table('cms_moduls')->where('path', '!=', '')->where('controller', '!=', '')->where('is_protected', 0)->get(); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | /* ROUTER FOR BACKEND CRUDBOOSTER */ |
28 | 28 | Route::group([ |
29 | - 'middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => $namespace,], function () use ($namespace){ |
|
29 | + 'middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => $namespace, ], function() use ($namespace){ |
|
30 | 30 | CRUDBooster::routeController('notifications', 'AdminNotificationsController', $namespace); |
31 | 31 | }); |
32 | 32 | |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | 'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBSuperadmin::class], |
35 | 35 | 'prefix' => cbAdminPath(), |
36 | 36 | 'namespace' => $namespace, |
37 | -], function () { |
|
38 | - Route::post('{module}/do-upload-import-data', ['uses' => 'FileController@uploadImportData', 'as' => 'UploadImportData',]); |
|
39 | - Route::post('{module}/upload-summernote', ['uses' => 'FileController@uploadSummernote', 'as' => 'UploadImportData',]); |
|
40 | - Route::post('{module}/upload-file', ['uses' => 'FileController@uploadFile', 'as' => 'UploadImportData',]); |
|
41 | - Route::post('{module}/done-import', ['uses' => 'FileController@doneImport', 'as' => 'doneImportData',]); |
|
37 | +], function() { |
|
38 | + Route::post('{module}/do-upload-import-data', ['uses' => 'FileController@uploadImportData', 'as' => 'UploadImportData', ]); |
|
39 | + Route::post('{module}/upload-summernote', ['uses' => 'FileController@uploadSummernote', 'as' => 'UploadImportData', ]); |
|
40 | + Route::post('{module}/upload-file', ['uses' => 'FileController@uploadFile', 'as' => 'UploadImportData', ]); |
|
41 | + Route::post('{module}/done-import', ['uses' => 'FileController@doneImport', 'as' => 'doneImportData', ]); |
|
42 | 42 | }); |
43 | 43 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | private function handleFile($name, $row_assign) |
50 | 50 | { |
51 | - if (! Request::hasFile($name)) { |
|
51 | + if (!Request::hasFile($name)) { |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | $file = Request::file($name); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $validator = Validator::make(request()->all(), $rules); |
21 | 21 | |
22 | - if (! $validator->fails()) { |
|
22 | + if (!$validator->fails()) { |
|
23 | 23 | return null; |
24 | 24 | } |
25 | 25 | |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | $rules = []; |
38 | 38 | foreach ($form as $formInput) { |
39 | 39 | $name = $formInput['name']; |
40 | - if (! $name) { |
|
40 | + if (!$name) { |
|
41 | 41 | continue; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $ai = []; |
45 | - if ($formInput['required'] && ! Request::hasFile($name)) { |
|
45 | + if ($formInput['required'] && !Request::hasFile($name)) { |
|
46 | 46 | $ai[] = 'required'; |
47 | 47 | } |
48 | 48 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $exp = explode('|', $di['validation']); |
73 | 73 | |
74 | - if (! count($exp)) { |
|
74 | + if (!count($exp)) { |
|
75 | 75 | return ''; |
76 | 76 | } |
77 | 77 |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | | ---------------------------------------------- |
53 | 53 | | |
54 | 54 | */ |
55 | - if (! $row_api->method_type) { |
|
55 | + if (!$row_api->method_type) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 | $method_type = $row_api->method_type; |
59 | - if ($method_type && ! Request::isMethod($method_type)) { |
|
59 | + if ($method_type && !Request::isMethod($method_type)) { |
|
60 | 60 | $result['api_status'] = 0; |
61 | 61 | $result['api_message'] = "The request method is not allowed !"; |
62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | | ---------------------------------------------- |
70 | 70 | | |
71 | 71 | */ |
72 | - if (! $row_api) { |
|
72 | + if (!$row_api) { |
|
73 | 73 | $result['api_status'] = 0; |
74 | 74 | $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.'; |
75 | 75 | |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | $value = $param['config']; |
173 | 173 | } |
174 | 174 | |
175 | - if ($required && $type == 'password' && ! Hash::check($value, $rows->{$name})) { |
|
175 | + if ($required && $type == 'password' && !Hash::check($value, $rows->{$name})) { |
|
176 | 176 | return $this->passwordError($result, $debug_mode_message, $posts); |
177 | 177 | } |
178 | 178 | |
179 | - if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) { |
|
179 | + if (!$required && $used && $value && !Hash::check($value, $row->{$name})) { |
|
180 | 180 | return $this->passwordError($result, $debug_mode_message, $posts); |
181 | 181 | } |
182 | 182 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | private function filterRows($data, $parameters, $posts, $table, $type_except) |
305 | 305 | { |
306 | - $data->where(function ($w) use ($parameters, $posts, $table, $type_except) { |
|
306 | + $data->where(function($w) use ($parameters, $posts, $table, $type_except) { |
|
307 | 307 | foreach ($parameters as $param) { |
308 | 308 | $name = $param['name']; |
309 | 309 | $type = $param['type']; |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $row->$k = asset($v); |
396 | 396 | } |
397 | 397 | |
398 | - if (! in_array($k, $responses_fields)) { |
|
398 | + if (!in_array($k, $responses_fields)) { |
|
399 | 399 | unset($row[$k]); |
400 | 400 | } |
401 | 401 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $rows->$k = asset($v); |
459 | 459 | } |
460 | 460 | |
461 | - if (! in_array($k, $responses_fields)) { |
|
461 | + if (!in_array($k, $responses_fields)) { |
|
462 | 462 | unset($row[$k]); |
463 | 463 | } |
464 | 464 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $subquery = $resp['subquery']; |
481 | 481 | $used = intval($resp['used']); |
482 | 482 | |
483 | - if ($used == 0 && ! CRUDBooster::isForeignKey($name)) { |
|
483 | + if ($used == 0 && !CRUDBooster::isForeignKey($name)) { |
|
484 | 484 | continue; |
485 | 485 | } |
486 | 486 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | */ |
536 | 536 | private function applyLike($data, $search_in, $value) |
537 | 537 | { |
538 | - $data->where(function ($w) use ($search_in, $value) { |
|
538 | + $data->where(function($w) use ($search_in, $value) { |
|
539 | 539 | foreach ($search_in as $k => $field) { |
540 | 540 | if ($k == 0) { |
541 | 541 | $w->where($field, "like", "%$value%"); |
@@ -23,9 +23,9 @@ |
||
23 | 23 | |
24 | 24 | if (in_array($type, ['unique', 'exists'])) { |
25 | 25 | $format_validation[] = $this->existOrUnique($config, $type); |
26 | - } elseif (in_array($type, ['date_format','digits_between', 'in', 'mimes', 'min', 'max', 'not_in'])) { |
|
26 | + } elseif (in_array($type, ['date_format', 'digits_between', 'in', 'mimes', 'min', 'max', 'not_in'])) { |
|
27 | 27 | $format_validation[] = $type.':'.$config; |
28 | - } elseif (! in_array($type, $typeExcept)) { |
|
28 | + } elseif (!in_array($type, $typeExcept)) { |
|
29 | 29 | $format_validation[] = $type; |
30 | 30 | } |
31 | 31 |