@@ -60,16 +60,16 @@ |
||
60 | 60 | $this->symlinkForAsset(); |
61 | 61 | |
62 | 62 | |
63 | - if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
63 | + if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
64 | 64 | $this->installCrudbooster(); |
65 | - }else{ |
|
66 | - $this->info('Setup Aborted !'); |
|
67 | - $this->info('Please setting the database configuration for first !'); |
|
68 | - } |
|
65 | + }else{ |
|
66 | + $this->info('Setup Aborted !'); |
|
67 | + $this->info('Please setting the database configuration for first !'); |
|
68 | + } |
|
69 | 69 | |
70 | 70 | $printer->printFooter(); |
71 | 71 | exit; |
72 | - } |
|
72 | + } |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Get the composer command for the environment. |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $printer->printHeader(); |
40 | 40 | |
41 | 41 | $passes = (new RequirementChecker())->check(); |
42 | - if(!$passes) { |
|
42 | + if (!$passes) { |
|
43 | 43 | $this->info('Sorry unfortunately your system is not meet with our requirements !'); |
44 | 44 | $this->printFooter(false); |
45 | 45 | $this->info('--'); |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $this->symlinkForAsset(); |
61 | 61 | |
62 | 62 | |
63 | - if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
63 | + if ($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
64 | 64 | $this->installCrudbooster(); |
65 | - }else{ |
|
65 | + } else { |
|
66 | 66 | $this->info('Setup Aborted !'); |
67 | 67 | $this->info('Please setting the database configuration for first !'); |
68 | 68 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (!file_exists($vendorPath)) { |
113 | 113 | $this->info('Creating public/vendor/crudbooster symlink...'); |
114 | 114 | app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster')); |
115 | - return ; |
|
115 | + return; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | $this->info('Vendor Path: '.$vendorPath); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->info('Migrating database...'); |
148 | 148 | $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']); |
149 | 149 | |
150 | - if (! class_exists('CBSeeder')) { |
|
150 | + if (!class_exists('CBSeeder')) { |
|
151 | 151 | require_once __DIR__.'/../database/seeds/CBSeeder.php'; |
152 | 152 | } |
153 | 153 | $this->callSilent('db:seed', ['--class' => 'CBSeeder']); |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | private function createVendorAtPublic() |
161 | 161 | { |
162 | 162 | $this->info('Checking public/vendor directory...'); |
163 | - if (! file_exists(public_path('vendor'))) { |
|
163 | + if (!file_exists(public_path('vendor'))) { |
|
164 | 164 | mkdir(public_path('vendor'), 0777); |
165 | 165 | } |
166 | 166 | |
167 | - if (! is_writable(public_path('vendor'))) { |
|
167 | + if (!is_writable(public_path('vendor'))) { |
|
168 | 168 | $this->info('Setup aborted !'); |
169 | 169 | $this->info('Please set public/vendor directory to writable 0777'); |
170 | 170 | exit; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | private function rrmdir($dir) |
177 | 177 | { |
178 | - if (! is_dir($dir)) { |
|
178 | + if (!is_dir($dir)) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | foreach (scandir($dir) as $object) { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public static function findPK($table) |
17 | 17 | { |
18 | - if (! $table) { |
|
18 | + if (!$table) { |
|
19 | 19 | return 'id'; |
20 | 20 | } |
21 | 21 | |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | } |
25 | 25 | $table = CRUDBooster::parseSqlTable($table); |
26 | 26 | |
27 | - if (! $table['table']) { |
|
27 | + if (!$table['table']) { |
|
28 | 28 | throw new \Exception("parseSqlTable can't determine the table"); |
29 | 29 | } |
30 | 30 | |
31 | 31 | $primary_key = self::findPKname($table); |
32 | 32 | |
33 | - if (! $primary_key) { |
|
33 | + if (!$primary_key) { |
|
34 | 34 | return 'id'; |
35 | 35 | } |
36 | 36 | CRUDBooster::putCache('table_'.$table, 'primary_key', $primary_key); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $cols = collect(DB::select('SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = :database AND TABLE_NAME = :table', [ |
101 | 101 | 'database' => $table['database'], |
102 | 102 | 'table' => $table['table'], |
103 | - ]))->map(function ($x) { |
|
103 | + ]))->map(function($x) { |
|
104 | 104 | return (array) $x; |
105 | 105 | })->toArray(); |
106 | 106 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $field = 'field_type_'.$table.'_'.$field; |
118 | 118 | |
119 | - return Cache::rememberForever($field, function () use ($table, $field) { |
|
119 | + return Cache::rememberForever($field, function() use ($table, $field) { |
|
120 | 120 | try { |
121 | 121 | //MySQL & SQL Server |
122 | 122 | $typedata = DB::select(DB::raw("select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$table' and COLUMN_NAME = '$field'"))[0]->DATA_TYPE; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | |
143 | 143 | $table = CRUDBooster::getTableForeignKey($fieldName); |
144 | - if (! $table) { |
|
144 | + if (!$table) { |
|
145 | 145 | return false; |
146 | 146 | } |
147 | 147 |
@@ -8,28 +8,28 @@ discard block |
||
8 | 8 | | --------------------------------------------------------------------------------------------------------------- |
9 | 9 | | |
10 | 10 | */ |
11 | -if (! function_exists('cbModulesNS')) { |
|
11 | +if (!function_exists('cbModulesNS')) { |
|
12 | 12 | function cbModulesNS($path = '') |
13 | 13 | { |
14 | 14 | return '\crocodicstudio\crudbooster\Modules\\'.$path; |
15 | 15 | } |
16 | 16 | } |
17 | 17 | |
18 | -if (! function_exists('cbAdminPath')) { |
|
18 | +if (!function_exists('cbAdminPath')) { |
|
19 | 19 | function cbAdminPath() |
20 | 20 | { |
21 | 21 | return cbConfig('ADMIN_PATH'); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | -if (! function_exists('ctrlNamespace')) { |
|
25 | +if (!function_exists('ctrlNamespace')) { |
|
26 | 26 | function ctrlNamespace() |
27 | 27 | { |
28 | 28 | return 'App\Http\Controllers'; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | -if (! function_exists('is_checked')) { |
|
32 | +if (!function_exists('is_checked')) { |
|
33 | 33 | /** |
34 | 34 | * @param $format |
35 | 35 | * @param $value |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | -if (! function_exists('controllers_dir')) { |
|
56 | +if (!function_exists('controllers_dir')) { |
|
57 | 57 | function controllers_dir() |
58 | 58 | { |
59 | 59 | $_ = DIRECTORY_SEPARATOR; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | -if (! function_exists('controller_path')) { |
|
64 | +if (!function_exists('controller_path')) { |
|
65 | 65 | function controller_path($controller) |
66 | 66 | { |
67 | 67 | $_ = DIRECTORY_SEPARATOR; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -if (! function_exists('extract_unit')) { |
|
72 | +if (!function_exists('extract_unit')) { |
|
73 | 73 | /* |
74 | 74 | Credits: Bit Repository |
75 | 75 | URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | -if (! function_exists('now')) { |
|
90 | +if (!function_exists('now')) { |
|
91 | 91 | function now() |
92 | 92 | { |
93 | 93 | return date('Y-m-d H:i:s'); |
@@ -101,17 +101,17 @@ discard block |
||
101 | 101 | | $name = name of input |
102 | 102 | | |
103 | 103 | */ |
104 | -if (! function_exists('g')) { |
|
104 | +if (!function_exists('g')) { |
|
105 | 105 | function g($name) |
106 | 106 | { |
107 | 107 | return Request::get($name); |
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | -if (! function_exists('min_var_export')) { |
|
111 | +if (!function_exists('min_var_export')) { |
|
112 | 112 | function min_var_export($input, $indent = "") |
113 | 113 | { |
114 | - if (! is_array($input)) { |
|
114 | + if (!is_array($input)) { |
|
115 | 115 | return var_export($input, true); |
116 | 116 | } |
117 | 117 | $buffer = []; |
@@ -126,41 +126,41 @@ discard block |
||
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | -if (! function_exists('cbTrans')) { |
|
129 | +if (!function_exists('cbTrans')) { |
|
130 | 130 | function cbTrans($key, $params = []) |
131 | 131 | { |
132 | 132 | return trans('crudbooster.'.$key, $params); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | -if (! function_exists('cbAsset')) { |
|
136 | +if (!function_exists('cbAsset')) { |
|
137 | 137 | function cbAsset($key) |
138 | 138 | { |
139 | 139 | return asset('vendor/crudbooster/assets/'.$key); |
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | -if (! function_exists('cbScript')) { |
|
143 | +if (!function_exists('cbScript')) { |
|
144 | 144 | function cbScript($key) |
145 | 145 | { |
146 | 146 | return '<script src="'.cbAsset($key).'" type="text/javascript"></script>'; |
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | -if (! function_exists('cbStyleSheet')) { |
|
150 | +if (!function_exists('cbStyleSheet')) { |
|
151 | 151 | function cbStyleSheet($key) |
152 | 152 | { |
153 | 153 | return '<link rel="stylesheet" type="text/css" href="'.cbAsset($key).'"/>'; |
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | -if (! function_exists('cbConfig')) { |
|
157 | +if (!function_exists('cbConfig')) { |
|
158 | 158 | function cbConfig($key, $default = null) |
159 | 159 | { |
160 | 160 | return config('crudbooster.'.$key, $default); |
161 | 161 | } |
162 | 162 | } |
163 | -if (! function_exists('makeValidationForHTML')) { |
|
163 | +if (!function_exists('makeValidationForHTML')) { |
|
164 | 164 | function makeValidationForHTML($rules) |
165 | 165 | { |
166 | 166 | $validation = []; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | -if (! function_exists('findSelected')) { |
|
181 | +if (!function_exists('findSelected')) { |
|
182 | 182 | /** |
183 | 183 | * @param $rawvalue |
184 | 184 | * @param $form |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | function findSelected($rawvalue, $form, $optionValue) |
189 | 189 | { |
190 | - if (! $rawvalue) { |
|
190 | + if (!$rawvalue) { |
|
191 | 191 | return ''; |
192 | 192 | } |
193 | 193 | $value = $rawvalue; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | return $selected; |
210 | 210 | } |
211 | 211 | } |
212 | -if (! function_exists('array_get_keys')) { |
|
212 | +if (!function_exists('array_get_keys')) { |
|
213 | 213 | |
214 | 214 | /** |
215 | 215 | * @param array $_array |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | -if (! function_exists('cbGetSetting')) { |
|
228 | +if (!function_exists('cbGetSetting')) { |
|
229 | 229 | function cbGetSetting($name) |
230 | 230 | { |
231 | 231 | return \crocodicstudio\crudbooster\Modules\SettingModule\SettingRepo::getSetting($name); |
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
235 | -if (! function_exists('backWithMsg')) { |
|
235 | +if (!function_exists('backWithMsg')) { |
|
236 | 236 | function backWithMsg($msg, $type = 'success') |
237 | 237 | { |
238 | 238 | sendAndTerminate(redirect()->back()->with(['message_type' => $type, 'message' => $msg])); |
@@ -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 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
78 | 78 | |
79 | - $this->app->singleton('crudbooster', function () { |
|
79 | + $this->app->singleton('crudbooster', function() { |
|
80 | 80 | return true; |
81 | 81 | }); |
82 | 82 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | private function registerCrudboosterCommand() |
119 | 119 | { |
120 | - $this->app->singleton('crudboosterinstall', function () { |
|
120 | + $this->app->singleton('crudboosterinstall', function() { |
|
121 | 121 | return new CrudboosterInstallationCommand; |
122 | 122 | }); |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | private function defineValidationRules() |
128 | 128 | { |
129 | - \Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
129 | + \Validator::extend('alpha_spaces', function($attribute, $value) { |
|
130 | 130 | // This will only accept alpha and spaces. |
131 | 131 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
132 | 132 | return preg_match('/^[\pL\s]+$/u', $value); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | |
84 | 84 | private function checkHideForm() |
85 | 85 | { |
86 | - if (! count($this->hide_form)) { |
|
86 | + if (!count($this->hide_form)) { |
|
87 | 87 | return null; |
88 | 88 | } |
89 | 89 | foreach ($this->form as $i => $f) { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $type = $form['type'] ?: 'text'; |
20 | 20 | $inputdata = request($name); |
21 | 21 | |
22 | - if (! $name || in_array($name, $hide_form) || $form['exception']) { |
|
22 | + if (!$name || in_array($name, $hide_form) || $form['exception']) { |
|
23 | 23 | continue; |
24 | 24 | } |
25 | 25 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | app(RelationHandler::class)->save($this->table, $id, $this->data_inputan); |
61 | 61 | $this->hookAfterAdd($id); |
62 | 62 | |
63 | - $this->insertLog('log_add', $id. ' on ' . $this->table); |
|
63 | + $this->insertLog('log_add', $id.' on '.$this->table); |
|
64 | 64 | |
65 | 65 | $this->sendResponseForSave('alert_add_data_success'); |
66 | 66 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | app(RelationHandler::class)->save($this->table, $id, $this->data_inputan); |
80 | 80 | $this->hookAfterEdit($id); |
81 | 81 | |
82 | - $this->insertLog('log_update', $id. ' on ' . $this->table); |
|
82 | + $this->insertLog('log_update', $id.' on '.$this->table); |
|
83 | 83 | |
84 | 84 | $this->sendResponseForSave('alert_update_data_success'); |
85 | 85 | } |
@@ -52,9 +52,9 @@ |
||
52 | 52 | */ |
53 | 53 | private function exportExcelAs($filename, $response, $orientation, $fmt) |
54 | 54 | { |
55 | - return Excel::create($filename, function ($excel) use ($response, $orientation, $filename) { |
|
55 | + return Excel::create($filename, function($excel) use ($response, $orientation, $filename) { |
|
56 | 56 | $excel->setTitle($filename)->setCreator("crudbooster.com")->setCompany(cbGetsetting('appname')); |
57 | - $excel->sheet($filename, function ($sheet) use ($response, $orientation) { |
|
57 | + $excel->sheet($filename, function($sheet) use ($response, $orientation) { |
|
58 | 58 | $sheet->setOrientation($orientation); |
59 | 59 | $sheet->loadview('crudbooster::export', $response); |
60 | 60 | }); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | function uploadImportData($file) |
50 | 50 | { |
51 | 51 | $dir = 'uploads/'.date('Y-m'); |
52 | - $filename = md5(str_random(5)).'.'. $file->getClientOriginalExtension(); |
|
52 | + $filename = md5(str_random(5)).'.'.$file->getClientOriginalExtension(); |
|
53 | 53 | |
54 | 54 | //Create Directory Monthly |
55 | 55 | Storage::makeDirectory($dir); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | function validateForImport($file) |
68 | 68 | { |
69 | - return Validator::make(['extension' => $file->getClientOriginalExtension(),], ['extension' => 'in:xls,xlsx,csv']); |
|
69 | + return Validator::make(['extension' => $file->getClientOriginalExtension(), ], ['extension' => 'in:xls,xlsx,csv']); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $file = base64_decode(request('file')); |
84 | 84 | $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.$file; |
85 | - $rows = Excel::load($file, function ($reader) { |
|
85 | + $rows = Excel::load($file, function($reader) { |
|
86 | 86 | })->get(); |
87 | 87 | |
88 | 88 | //$data_import_column = []; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | foreach ($select_column as $sk => $s) { |
128 | 128 | $colname = $table_columns[$sk]; |
129 | 129 | |
130 | - if (! CRUDBooster::isForeignKey($colname) || intval($value->$s)) { |
|
130 | + if (!CRUDBooster::isForeignKey($colname) || intval($value->$s)) { |
|
131 | 131 | $a[$colname] = $value->$s; |
132 | 132 | continue; |
133 | 133 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $relation_moduls = DB::table('cms_moduls')->where('table_name', $relation_table)->first(); |
142 | 142 | |
143 | 143 | $relation_class = __NAMESPACE__.'\\'.$relation_moduls->controller; |
144 | - if (! class_exists($relation_class)) { |
|
144 | + if (!class_exists($relation_class)) { |
|
145 | 145 | $relation_class = '\App\Http\Controllers\\'.$relation_moduls->controller; |
146 | 146 | } |
147 | 147 | $relation_class = new $relation_class; |