@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $ctrl->hookValidate(); |
46 | 46 | |
47 | - if (! $ctrl->validate) { |
|
47 | + if (!$ctrl->validate) { |
|
48 | 48 | return true; |
49 | 49 | } // hook have to return true |
50 | 50 | //todo : translation |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public static function sidebarMenu() |
11 | 11 | { |
12 | - $conditions = [ |
|
12 | + $conditions = [ |
|
13 | 13 | 'cms_privileges' => CRUDBooster::myPrivilegeId(), |
14 | 14 | 'parent_id' => 0, |
15 | 15 | 'is_active' => 1, |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function boot() |
15 | 15 | { |
16 | - $this->loadRoutesFrom( __DIR__.'/logs_routes.php'); |
|
16 | + $this->loadRoutesFrom(__DIR__.'/logs_routes.php'); |
|
17 | 17 | $this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization'); |
18 | 18 | } |
19 | 19 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function boot() |
15 | 15 | { |
16 | 16 | $this->app['view']->addNamespace('CbPrivilege', __DIR__.'/views'); |
17 | - $this->loadRoutesFrom( __DIR__.'/privileges_routes.php'); |
|
17 | + $this->loadRoutesFrom(__DIR__.'/privileges_routes.php'); |
|
18 | 18 | $this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization'); |
19 | 19 | } |
20 | 20 |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | __DIR__.'/userfiles/views/vendor/crudbooster/type_components/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'), |
54 | 54 | ], 'cb_type_components'); |
55 | 55 | |
56 | - if (! file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
56 | + if (!file_exists(app_path('Http/Controllers/CBHook.php'))) { |
|
57 | 57 | $this->publishes([__DIR__.'/userfiles/controllers/CBHook.php' => app_path('Http/Controllers/CBHook.php')], 'CBHook'); |
58 | 58 | } |
59 | 59 | |
60 | - if (! file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
60 | + if (!file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
61 | 61 | $this->publishes([__DIR__.'/userfiles/controllers/AdminUsersController.php' => app_path('Http/Controllers/AdminUsersController.php')], 'cb_user_controller'); |
62 | 62 | } |
63 | 63 | |
64 | 64 | $this->defineValidationRules(); |
65 | - $this->loadRoutesFrom( __DIR__.'/routes.php'); |
|
65 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
76 | 76 | |
77 | - $this->app->singleton('crudbooster', function () { |
|
77 | + $this->app->singleton('crudbooster', function() { |
|
78 | 78 | return true; |
79 | 79 | }); |
80 | 80 | |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | |
117 | 117 | private function registerCrudboosterCommand() |
118 | 118 | { |
119 | - $this->app->singleton('crudboosterinstall', function () { |
|
119 | + $this->app->singleton('crudboosterinstall', function() { |
|
120 | 120 | return new CrudboosterInstallationCommand; |
121 | 121 | }); |
122 | 122 | } |
123 | 123 | |
124 | 124 | private function defineValidationRules() |
125 | 125 | { |
126 | - \Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
126 | + \Validator::extend('alpha_spaces', function($attribute, $value) { |
|
127 | 127 | // This will only accept alpha and spaces. |
128 | 128 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
129 | 129 | return preg_match('/^[\pL\s]+$/u', $value); |
@@ -149,7 +149,7 @@ |
||
149 | 149 | protected function genericLoader() |
150 | 150 | { |
151 | 151 | $this->cbInit(); |
152 | - $this->primaryKey = $this->primaryKey?: DbInspector::findPk($this->table); |
|
152 | + $this->primaryKey = $this->primaryKey ?: DbInspector::findPk($this->table); |
|
153 | 153 | $this->data_inputan = $this->form; |
154 | 154 | $this->data['pk'] = $this->primaryKey; |
155 | 155 | $this->data['hide_form'] = $this->hide_form; |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | { |
45 | 45 | $path = request('path') ? base64_decode(request('path')) : 'uploads'; |
46 | 46 | $file = Request::file('userfile'); |
47 | - if (! $file) { |
|
47 | + if (!$file) { |
|
48 | 48 | return null; |
49 | 49 | } |
50 | 50 | |
51 | 51 | $fileName = $file->getClientOriginalName(); |
52 | 52 | |
53 | - if (! FieldDetector::isUploadField($file->getClientOriginalExtension())) { |
|
53 | + if (!FieldDetector::isUploadField($file->getClientOriginalExtension())) { |
|
54 | 54 | backWithMsg('The file '.$fileName.' type is not allowed!', 'warning'); |
55 | 55 | } |
56 | 56 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function getDeleteFile($file) |
71 | 71 | { |
72 | 72 | $file = base64_decode($file); |
73 | - if(Storage::delete($file)) |
|
73 | + if (Storage::delete($file)) |
|
74 | 74 | backWithMsg('The file has been deleted!'); |
75 | 75 | |
76 | 76 | backWithMsg('The file did not deleted!', 'warning'); |
@@ -70,8 +70,9 @@ |
||
70 | 70 | public function getDeleteFile($file) |
71 | 71 | { |
72 | 72 | $file = base64_decode($file); |
73 | - if(Storage::delete($file)) |
|
74 | - backWithMsg('The file has been deleted!'); |
|
73 | + if(Storage::delete($file)) { |
|
74 | + backWithMsg('The file has been deleted!'); |
|
75 | + } |
|
75 | 76 | |
76 | 77 | backWithMsg('The file did not deleted!', 'warning'); |
77 | 78 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | public function createVendorAtPublic() |
29 | 29 | { |
30 | 30 | $this->console->info('Checking public/vendor directory...'); |
31 | - if (! file_exists(public_path('vendor'))) { |
|
31 | + if (!file_exists(public_path('vendor'))) { |
|
32 | 32 | mkdir(public_path('vendor'), 0777); |
33 | 33 | } |
34 | 34 | |
35 | - if (! is_writable(public_path('vendor'))) { |
|
35 | + if (!is_writable(public_path('vendor'))) { |
|
36 | 36 | $this->console->info('Setup aborted !'); |
37 | 37 | $this->console->info('Please set public/vendor directory to writable 0777'); |
38 | 38 | exit; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function symlinkForUpload() |
43 | 43 | { |
44 | 44 | $this->console->info('Checking public/uploads symlink...'); |
45 | - if (! file_exists(public_path('uploads'))) { |
|
45 | + if (!file_exists(public_path('uploads'))) { |
|
46 | 46 | $this->console->info('Creating public/uploads symlink...'); |
47 | 47 | app('files')->link(storage_path('app'), public_path('uploads')); |
48 | 48 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function rrmdir($dir) |
61 | 61 | { |
62 | - if (! is_dir($dir)) { |
|
62 | + if (!is_dir($dir)) { |
|
63 | 63 | return; |
64 | 64 | } |
65 | 65 | foreach (scandir($dir) as $object) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | $vendorPath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'); |
86 | 86 | $ds = DIRECTORY_SEPARATOR; |
87 | - if (! file_exists($vendorPath)) { |
|
87 | + if (!file_exists($vendorPath)) { |
|
88 | 88 | $this->console->info('Creating public/vendor/crudbooster symlink...'); |
89 | 89 | app('files')->link(base_path('vendor'.$ds.'crocodicstudio'.$ds.'crudbooster'.$ds.'src'.$ds.'assets'), public_path('vendor/crudbooster')); |
90 | 90 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->console->info('Migrating database...'); |
117 | 117 | $this->console->call('migrate', ['--path' => '\database\migrations\crudbooster']); |
118 | 118 | |
119 | - if (! class_exists('CBSeeder')) { |
|
119 | + if (!class_exists('CBSeeder')) { |
|
120 | 120 | $ds = DIRECTORY_SEPARATOR; |
121 | 121 | base_path('vendor'.$ds.'crocodicstudio'.$ds.'crudbooster'.$ds.'src'.$ds.'database'.$ds.'seeds'.$ds.'CBSeeder.php'); |
122 | 122 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | $namespace = cbControllersNS(); |
7 | 7 | /* ROUTER FOR UPLOADS */ |
8 | -Route::group(['middleware' => ['web'], 'namespace' => $namespace], function () { |
|
8 | +Route::group(['middleware' => ['web'], 'namespace' => $namespace], function() { |
|
9 | 9 | Route::get('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', ['uses' => 'FileController@getPreview', 'as' => 'fileControllerPreview']); |
10 | 10 | }); |
11 | 11 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | 'middleware' => ['web', CBBackend::class], |
15 | 15 | 'prefix' => cbAdminPath(), |
16 | 16 | 'namespace' => ctrlNamespace(), |
17 | -], function () { |
|
17 | +], function() { |
|
18 | 18 | try { |
19 | 19 | $modules = DB::table('cms_moduls')->where('path', '!=', '')->where('controller', '!=', '')->where('is_protected', 0)->get(); |
20 | 20 | foreach ($modules as $module) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBSuperadmin::class], |
31 | 31 | 'prefix' => cbAdminPath(), |
32 | 32 | 'namespace' => $namespace, |
33 | -], function () { |
|
33 | +], function() { |
|
34 | 34 | Route::post('{module}/do-upload-import-data', 'FileController@uploadImportData')->name('UploadImportData'); |
35 | 35 | Route::post('{module}/upload-summernote', 'FileController@uploadSummernote')->name('UploadImportData'); |
36 | 36 | Route::post('{module}/upload-file', 'FileController@uploadFile')->name('UploadImportData'); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | CbRouter::routeController($module->path, $module->controller); |
22 | 22 | } |
23 | 23 | } catch (Exception $e) { |
24 | - dd($e); |
|
24 | + dd($e); |
|
25 | 25 | } |
26 | 26 | }); |
27 | 27 |