Passed
Push — master ( e7f23e...f5f59c )
by Ferry
04:24
created
src/helpers/Helper.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -220,20 +220,20 @@  discard block
 block discarded – undo
220 220
 }
221 221
 
222 222
 if(!function_exists('extract_unit')) {	
223
-	/*
223
+    /*
224 224
 	Credits: Bit Repository
225 225
 	URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html
226 226
 	*/
227
-	function extract_unit($string, $start, $end)
228
-	{
229
-	$pos = stripos($string, $start);
230
-	$str = substr($string, $pos);
231
-	$str_two = substr($str, strlen($start));
232
-	$second_pos = stripos($str_two, $end);
233
-	$str_three = substr($str_two, 0, $second_pos);
234
-	$unit = trim($str_three); // remove whitespaces
235
-	return $unit;
236
-	}
227
+    function extract_unit($string, $start, $end)
228
+    {
229
+    $pos = stripos($string, $start);
230
+    $str = substr($string, $pos);
231
+    $str_two = substr($str, strlen($start));
232
+    $second_pos = stripos($str_two, $end);
233
+    $str_three = substr($str_two, 0, $second_pos);
234
+    $unit = trim($str_three); // remove whitespaces
235
+    return $unit;
236
+    }
237 237
 }
238 238
 
239 239
 /* 
@@ -407,22 +407,22 @@  discard block
 block discarded – undo
407 407
 }
408 408
 
409 409
 if(!function_exists('rrmdir')) {
410
-	/*
410
+    /*
411 411
 	* http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-files-sub-dir
412 412
 	*/
413
-	function rrmdir($dir) { 
414
-	   if (is_dir($dir)) { 
415
-	     $objects = scandir($dir); 
416
-	     foreach ($objects as $object) { 
417
-	       if ($object != "." && $object != "..") { 
418
-	         if (is_dir($dir."/".$object))
419
-	           rrmdir($dir."/".$object);
420
-	         else
421
-	           unlink($dir."/".$object); 
422
-	       } 
423
-	     }
424
-	     rmdir($dir); 
425
-	   } 
426
-	 }
413
+    function rrmdir($dir) { 
414
+        if (is_dir($dir)) { 
415
+            $objects = scandir($dir); 
416
+            foreach ($objects as $object) { 
417
+            if ($object != "." && $object != "..") { 
418
+                if (is_dir($dir."/".$object))
419
+                rrmdir($dir."/".$object);
420
+                else
421
+                unlink($dir."/".$object); 
422
+            } 
423
+            }
424
+            rmdir($dir); 
425
+        } 
426
+        }
427 427
 }
428 428
 
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!function_exists("putHtaccess")) {
3
+if (!function_exists("putHtaccess")) {
4 4
     function putHtaccess($stringToPut)
5 5
     {
6 6
         file_put_contents(base_path(".htaccess"), "\n".$stringToPut, FILE_APPEND);
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
     }
9 9
 }
10 10
 
11
-if(!function_exists("checkHtaccess")) {
11
+if (!function_exists("checkHtaccess")) {
12 12
     function checkHtaccess($stringToCheck)
13 13
     {
14
-        if(file_exists(base_path(".htaccess")) && file_exists(public_path(".htaccess"))) {
14
+        if (file_exists(base_path(".htaccess")) && file_exists(public_path(".htaccess"))) {
15 15
             $htaccess = file_get_contents(base_path(".htaccess"));
16
-            $htaccess2= file_get_contents(public_path(".htaccess"));
17
-            if(\Illuminate\Support\Str::contains($htaccess, $stringToCheck) && \Illuminate\Support\Str::contains($htaccess2, $stringToCheck)) {
16
+            $htaccess2 = file_get_contents(public_path(".htaccess"));
17
+            if (\Illuminate\Support\Str::contains($htaccess, $stringToCheck) && \Illuminate\Support\Str::contains($htaccess2, $stringToCheck)) {
18 18
                 return true;
19 19
             }
20 20
         }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     }
24 24
 }
25 25
 
26
-if(!function_exists("setEnvironmentValue")) {
26
+if (!function_exists("setEnvironmentValue")) {
27 27
     function setEnvironmentValue(array $values)
28 28
     {
29 29
         $envFile = app()->environmentFilePath();
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 }
55 55
 
56 56
 
57
-if(!function_exists("cbLang")) {
57
+if (!function_exists("cbLang")) {
58 58
     /**
59 59
      * @param string $key
60 60
      * @param array $replace
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
     }
67 67
 }
68 68
 
69
-if(!function_exists('rglob')) {
69
+if (!function_exists('rglob')) {
70 70
     function rglob($pattern, $flags = 0) {
71 71
         $files = glob($pattern, $flags);
72
-        foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
72
+        foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
73 73
             $files = array_merge($files, rglob($dir.'/'.basename($pattern), $flags));
74 74
         }
75 75
         return $files;
76 76
     }
77 77
 }
78 78
 
79
-if(!function_exists('convertPHPToMomentFormat')) {
79
+if (!function_exists('convertPHPToMomentFormat')) {
80 80
     function convertPHPToMomentFormat($format)
81 81
     {
82 82
         $replacements = [
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
     }
124 124
 }
125 125
 
126
-if(!function_exists('slug')) {
126
+if (!function_exists('slug')) {
127 127
     function slug($string, $separator = '-') {
128 128
         return \Illuminate\Support\Str::slug($string, $separator);
129 129
     }
130 130
 }
131 131
 
132
-if(!function_exists('columnSingleton')) {
132
+if (!function_exists('columnSingleton')) {
133 133
     /**
134 134
      * @return \crocodicstudio\crudbooster\controllers\scaffolding\singletons\ColumnSingleton
135 135
      */
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     }
139 139
 }
140 140
 
141
-if(!function_exists('cbHook'))
141
+if (!function_exists('cbHook'))
142 142
 {
143 143
     /**
144 144
      * @return crocodicstudio\crudbooster\hooks\CBHook
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     }
151 151
 }
152 152
 
153
-if(!function_exists('getTypeHook'))
153
+if (!function_exists('getTypeHook'))
154 154
 {
155 155
     /**
156 156
      * @param string $type
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     }
164 164
 }
165 165
 
166
-if(!function_exists('getPrimaryKey'))
166
+if (!function_exists('getPrimaryKey'))
167 167
 {
168 168
     function getPrimaryKey($table_name)
169 169
     {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     }
172 172
 }
173 173
 
174
-if(!function_exists('cb'))
174
+if (!function_exists('cb'))
175 175
 {
176 176
     function cb()
177 177
     {
@@ -179,25 +179,25 @@  discard block
 block discarded – undo
179 179
     }
180 180
 }
181 181
 
182
-if(!function_exists('cbAsset')) {
182
+if (!function_exists('cbAsset')) {
183 183
     function cbAsset($path, $secure = null) {
184 184
         return asset("cb_asset/".$path, $secure);
185 185
     }
186 186
 }
187 187
 
188
-if(!function_exists("cbConfig")) {
188
+if (!function_exists("cbConfig")) {
189 189
     function cbConfig($name, $default = null) {
190 190
         return config("crudbooster.".$name, $default);
191 191
     }
192 192
 }
193 193
 
194
-if(!function_exists("strRandom")) {
194
+if (!function_exists("strRandom")) {
195 195
     function strRandom($length = 5) {
196 196
         return \Illuminate\Support\Str::random($length);
197 197
     }
198 198
 }
199 199
 
200
-if(!function_exists('module')) {
200
+if (!function_exists('module')) {
201 201
     function module()
202 202
     {
203 203
         $module = new \crocodicstudio\crudbooster\helpers\Module();
@@ -205,21 +205,21 @@  discard block
 block discarded – undo
205 205
     }
206 206
 }
207 207
 
208
-if(!function_exists('getAdminLoginURL')) {
208
+if (!function_exists('getAdminLoginURL')) {
209 209
     function getAdminLoginURL()
210 210
     {
211 211
         return cb()->getAdminUrl("login");
212 212
     }
213 213
 }
214 214
 
215
-if(!function_exists('dummyPhoto')) {
215
+if (!function_exists('dummyPhoto')) {
216 216
     function dummyPhoto()
217 217
     {
218 218
         return cbConfig("DUMMY_PHOTO");
219 219
     }
220 220
 }
221 221
 
222
-if(!function_exists('extract_unit')) {	
222
+if (!function_exists('extract_unit')) {	
223 223
 	/*
224 224
 	Credits: Bit Repository
225 225
 	URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html
@@ -244,14 +244,14 @@  discard block
 block discarded – undo
244 244
 |
245 245
 */
246 246
 
247
-if(!function_exists('putSetting')) {
247
+if (!function_exists('putSetting')) {
248 248
     function putSetting($key, $value)
249 249
     {
250
-        if(file_exists(storage_path('.cbconfig'))) {
250
+        if (file_exists(storage_path('.cbconfig'))) {
251 251
             $settings = file_get_contents(storage_path('.cbconfig'));
252 252
             $settings = decrypt($settings);
253 253
             $settings = unserialize($settings);
254
-        }else{
254
+        } else {
255 255
             $settings = [];
256 256
         }
257 257
 
@@ -265,31 +265,31 @@  discard block
 block discarded – undo
265 265
     }
266 266
 }
267 267
 
268
-if(!function_exists('getSetting')) {
268
+if (!function_exists('getSetting')) {
269 269
     function getSetting($key, $default = null)
270 270
     {
271
-        if($cache = \Illuminate\Support\Facades\Cache::get("setting_".$key)) {
271
+        if ($cache = \Illuminate\Support\Facades\Cache::get("setting_".$key)) {
272 272
             return $cache;
273 273
         }
274 274
 
275
-        if(file_exists(storage_path('.cbconfig'))) {
275
+        if (file_exists(storage_path('.cbconfig'))) {
276 276
             $settings = file_get_contents(storage_path('.cbconfig'));
277 277
             $settings = decrypt($settings);
278 278
             $settings = unserialize($settings);
279
-        }else{
279
+        } else {
280 280
             $settings = [];
281 281
         }
282 282
 
283
-        if(isset($settings[$key])) {
283
+        if (isset($settings[$key])) {
284 284
             \Illuminate\Support\Facades\Cache::forever("setting_".$key, $settings[$key]);
285
-            return $settings[$key]?:$default;
286
-        }else{
285
+            return $settings[$key] ?: $default;
286
+        } else {
287 287
             return $default;
288 288
         }
289 289
     }
290 290
 }
291 291
 
292
-if(!function_exists('timeAgo')) {
292
+if (!function_exists('timeAgo')) {
293 293
     function timeAgo($datetime_to, $datetime_from = null, $full = false)
294 294
     {
295 295
         $datetime_from = ($datetime_from) ?: date('Y-m-d H:i:s');
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             }
321 321
         }
322 322
 
323
-        if (! $full) {
323
+        if (!$full) {
324 324
             $string = array_slice($string, 0, 1);
325 325
         }
326 326
 
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
     }
329 329
 }
330 330
 
331
-if(!function_exists("array_map_r")) {
332
-    function array_map_r( $func, $arr )
331
+if (!function_exists("array_map_r")) {
332
+    function array_map_r($func, $arr)
333 333
     {
334 334
         $newArr = array();
335 335
 
336
-        foreach( $arr as $key => $value )
336
+        foreach ($arr as $key => $value)
337 337
         {
338 338
             $key = $func($key);
339
-            $newArr[ $key ] = ( is_array( $value ) ? array_map_r( $func, $value ) : ( is_array($func) ? call_user_func_array($func, $value) : $func( $value ) ) );
339
+            $newArr[$key] = (is_array($value) ? array_map_r($func, $value) : (is_array($func) ? call_user_func_array($func, $value) : $func($value)));
340 340
         }
341 341
 
342 342
         return $newArr;
343 343
     }
344 344
 }
345 345
 
346
-if(!function_exists("sanitizeXSS"))
346
+if (!function_exists("sanitizeXSS"))
347 347
 {
348 348
     function sanitizeXSS($value)
349 349
     {
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
     }
356 356
 }
357 357
 
358
-if(!function_exists("requestAll")) {
358
+if (!function_exists("requestAll")) {
359 359
     function requestAll() {
360 360
         $all = array_map_r("sanitizeXSS", request()->all());
361 361
         return $all;
@@ -364,22 +364,22 @@  discard block
 block discarded – undo
364 364
 
365 365
 
366 366
 
367
-if(!function_exists('getURLFormat')) {
367
+if (!function_exists('getURLFormat')) {
368 368
     function getURLFormat($name) {
369 369
         $url = request($name);
370
-        if(filter_var($url, FILTER_VALIDATE_URL)) {
370
+        if (filter_var($url, FILTER_VALIDATE_URL)) {
371 371
             return $url;
372
-        }else{
372
+        } else {
373 373
             return request()->url();
374 374
         }
375 375
     }
376 376
 }
377 377
 
378
-if(!function_exists('g')) {
378
+if (!function_exists('g')) {
379 379
     function g($name, $safe = true) {
380
-        if($safe == true) {
380
+        if ($safe == true) {
381 381
             $response = request($name);
382
-            if(is_string($response)) {
382
+            if (is_string($response)) {
383 383
                 $response = sanitizeXSS($response);
384 384
             }elseif (is_array($response)) {
385 385
                 array_walk_recursive($response, function(&$response) {
@@ -388,25 +388,25 @@  discard block
 block discarded – undo
388 388
             }
389 389
 
390 390
             return $response;
391
-        }else{
391
+        } else {
392 392
             return Request::get($name);
393 393
         }
394 394
     }
395 395
 }
396 396
 
397
-if(!function_exists('min_var_export')) {
397
+if (!function_exists('min_var_export')) {
398 398
     function min_var_export($input) {
399
-        if(is_array($input)) {
399
+        if (is_array($input)) {
400 400
             $buffer = [];
401
-            foreach($input as $key => $value)
401
+            foreach ($input as $key => $value)
402 402
                 $buffer[] = var_export($key, true)."=>".min_var_export($value);
403
-            return "[".implode(",",$buffer)."]";
403
+            return "[".implode(",", $buffer)."]";
404 404
         } else
405 405
             return var_export($input, true);
406 406
     }
407 407
 }
408 408
 
409
-if(!function_exists('rrmdir')) {
409
+if (!function_exists('rrmdir')) {
410 410
 	/*
411 411
 	* http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-files-sub-dir
412 412
 	*/
Please login to merge, or discard this patch.
Braces   +20 added lines, -15 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
         }
49 49
 
50 50
         $str = substr($str, 0, -1);
51
-        if (!file_put_contents($envFile, $str)) return false;
51
+        if (!file_put_contents($envFile, $str)) {
52
+            return false;
53
+        }
52 54
         return true;
53 55
     }
54 56
 }
@@ -251,7 +253,7 @@  discard block
 block discarded – undo
251 253
             $settings = file_get_contents(storage_path('.cbconfig'));
252 254
             $settings = decrypt($settings);
253 255
             $settings = unserialize($settings);
254
-        }else{
256
+        } else{
255 257
             $settings = [];
256 258
         }
257 259
 
@@ -276,14 +278,14 @@  discard block
 block discarded – undo
276 278
             $settings = file_get_contents(storage_path('.cbconfig'));
277 279
             $settings = decrypt($settings);
278 280
             $settings = unserialize($settings);
279
-        }else{
281
+        } else{
280 282
             $settings = [];
281 283
         }
282 284
 
283 285
         if(isset($settings[$key])) {
284 286
             \Illuminate\Support\Facades\Cache::forever("setting_".$key, $settings[$key]);
285 287
             return $settings[$key]?:$default;
286
-        }else{
288
+        } else{
287 289
             return $default;
288 290
         }
289 291
     }
@@ -369,7 +371,7 @@  discard block
 block discarded – undo
369 371
         $url = request($name);
370 372
         if(filter_var($url, FILTER_VALIDATE_URL)) {
371 373
             return $url;
372
-        }else{
374
+        } else{
373 375
             return request()->url();
374 376
         }
375 377
     }
@@ -381,14 +383,14 @@  discard block
 block discarded – undo
381 383
             $response = request($name);
382 384
             if(is_string($response)) {
383 385
                 $response = sanitizeXSS($response);
384
-            }elseif (is_array($response)) {
386
+            } elseif (is_array($response)) {
385 387
                 array_walk_recursive($response, function(&$response) {
386 388
                     $response = sanitizeXSS($response);
387 389
                 });
388 390
             }
389 391
 
390 392
             return $response;
391
-        }else{
393
+        } else{
392 394
             return Request::get($name);
393 395
         }
394 396
     }
@@ -398,11 +400,13 @@  discard block
 block discarded – undo
398 400
     function min_var_export($input) {
399 401
         if(is_array($input)) {
400 402
             $buffer = [];
401
-            foreach($input as $key => $value)
402
-                $buffer[] = var_export($key, true)."=>".min_var_export($value);
403
+            foreach($input as $key => $value) {
404
+                            $buffer[] = var_export($key, true)."=>".min_var_export($value);
405
+            }
403 406
             return "[".implode(",",$buffer)."]";
404
-        } else
405
-            return var_export($input, true);
407
+        } else {
408
+                    return var_export($input, true);
409
+        }
406 410
     }
407 411
 }
408 412
 
@@ -415,10 +419,11 @@  discard block
 block discarded – undo
415 419
 	     $objects = scandir($dir); 
416 420
 	     foreach ($objects as $object) { 
417 421
 	       if ($object != "." && $object != "..") { 
418
-	         if (is_dir($dir."/".$object))
419
-	           rrmdir($dir."/".$object);
420
-	         else
421
-	           unlink($dir."/".$object); 
422
+	         if (is_dir($dir."/".$object)) {
423
+	         	           rrmdir($dir."/".$object);
424
+	         } else {
425
+	         	           unlink($dir."/".$object);
426
+	         }
422 427
 	       } 
423 428
 	     }
424 429
 	     rmdir($dir); 
Please login to merge, or discard this patch.
src/helpers/CurlHelper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function headers(array $headers) {
27 27
         $newHeaders = [];
28
-        foreach($headers as $key=>$val) {
28
+        foreach ($headers as $key=>$val) {
29 29
             $newHeaders[] = $key.": ".$val;
30 30
         }
31 31
         $this->headers = $newHeaders;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
         $err = curl_error($ch);
48 48
         curl_close($ch);
49 49
 
50
-        if($err) {
50
+        if ($err) {
51 51
             return $err;
52
-        }else {
52
+        } else {
53 53
             return $response;
54 54
         }
55 55
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
         if($err) {
51 51
             return $err;
52
-        }else {
52
+        } else {
53 53
             return $response;
54 54
         }
55 55
     }
Please login to merge, or discard this patch.
src/commands/Install.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         if ($this->confirm('Do you have setting the database configuration at .env ?')) {
41 41
 
42
-            if (! file_exists(public_path('vendor')) ) {
42
+            if (!file_exists(public_path('vendor'))) {
43 43
                 mkdir(public_path('vendor'));
44 44
             }
45 45
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             /*
53 53
              * Create CBPlugins
54 54
              */
55
-            if(!file_exists(app_path("CBPlugins"))) {
55
+            if (!file_exists(app_path("CBPlugins"))) {
56 56
                 mkdir(app_path("CBPlugins"));
57 57
             }
58 58
 
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
              * We need it to change default laravel local filesystem from storage to public
62 62
              * We won't use symlink because of a security issue in many server
63 63
              */
64
-            if(!file_exists(public_path("storage"))) {
64
+            if (!file_exists(public_path("storage"))) {
65 65
                 $this->info("Create storage directory on /public");
66 66
                 mkdir(public_path("storage"));
67
-                file_put_contents(public_path("storage/.gitignore"),"!.gitignore");
68
-                file_put_contents(public_path("storage/index.html"),"&nbsp;");
67
+                file_put_contents(public_path("storage/.gitignore"), "!.gitignore");
68
+                file_put_contents(public_path("storage/index.html"), "&nbsp;");
69 69
             }
70 70
 
71 71
             /*
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
              * Disable php execution on /vendor/*
75 75
              */
76 76
             $this->info("Tweak some security for your laravel");
77
-            file_put_contents(base_path(".htaccess"), "\n\n# Generated by CRUDBooster\nServerSignature Off\nIndexIgnore *\nRewriteRule ^(.*)/vendor/.*\.(php|rb|py)$ - [F,L,NC]\nRewriteRule ^vendor/.*\.(php|rb|py)$ - [F,L,NC]\n<FilesMatch \"^\.\">\nOrder allow,deny\nDeny from all\n</FilesMatch>",FILE_APPEND);
78
-            file_put_contents(public_path(".htaccess"), "\n\n# Generated by CRUDBooster\nServerSignature Off\nIndexIgnore *\nRewriteRule ^(.*)/vendor/.*\.(php|rb|py)$ - [F,L,NC]\nRewriteRule ^vendor/.*\.(php|rb|py)$ - [F,L,NC]\n<FilesMatch \"^\.\">\nOrder allow,deny\nDeny from all\n</FilesMatch>",FILE_APPEND);
77
+            file_put_contents(base_path(".htaccess"), "\n\n# Generated by CRUDBooster\nServerSignature Off\nIndexIgnore *\nRewriteRule ^(.*)/vendor/.*\.(php|rb|py)$ - [F,L,NC]\nRewriteRule ^vendor/.*\.(php|rb|py)$ - [F,L,NC]\n<FilesMatch \"^\.\">\nOrder allow,deny\nDeny from all\n</FilesMatch>", FILE_APPEND);
78
+            file_put_contents(public_path(".htaccess"), "\n\n# Generated by CRUDBooster\nServerSignature Off\nIndexIgnore *\nRewriteRule ^(.*)/vendor/.*\.(php|rb|py)$ - [F,L,NC]\nRewriteRule ^vendor/.*\.(php|rb|py)$ - [F,L,NC]\n<FilesMatch \"^\.\">\nOrder allow,deny\nDeny from all\n</FilesMatch>", FILE_APPEND);
79 79
 
80 80
 
81 81
             $this->info('Dumping the autoloaded files and reloading all new files...');
Please login to merge, or discard this patch.
src/routes.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Developer Backend Middleware
4
-Route::group(['middleware' => ['web',\crocodicstudio\crudbooster\middlewares\CBDeveloper::class],
4
+Route::group(['middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBDeveloper::class],
5 5
     'prefix'=>"developer/".getSetting('developer_path'),
6
-    'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
6
+    'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
7 7
     cb()->routeController("modules", "\crocodicstudio\crudbooster\controllers\DeveloperModulesController");
8 8
     cb()->routeController("menus", "\crocodicstudio\crudbooster\controllers\DeveloperMenusController");
9
-    cb()->routeController("roles","\crocodicstudio\crudbooster\controllers\DeveloperRolesController");
10
-    cb()->routeController("users","\crocodicstudio\crudbooster\controllers\DeveloperUsersController");
11
-    cb()->routeController("plugins","\crocodicstudio\crudbooster\controllers\DeveloperPluginStoreController");
12
-    cb()->routeController("mail","\crocodicstudio\crudbooster\controllers\DeveloperMailController");
13
-    cb()->routeController("security","\crocodicstudio\crudbooster\controllers\DeveloperSecurityController");
14
-    cb()->routePost("skip-tutorial","DeveloperDashboardController@postSkipTutorial");
15
-    cb()->routeGet("/","DeveloperDashboardController@getIndex");
9
+    cb()->routeController("roles", "\crocodicstudio\crudbooster\controllers\DeveloperRolesController");
10
+    cb()->routeController("users", "\crocodicstudio\crudbooster\controllers\DeveloperUsersController");
11
+    cb()->routeController("plugins", "\crocodicstudio\crudbooster\controllers\DeveloperPluginStoreController");
12
+    cb()->routeController("mail", "\crocodicstudio\crudbooster\controllers\DeveloperMailController");
13
+    cb()->routeController("security", "\crocodicstudio\crudbooster\controllers\DeveloperSecurityController");
14
+    cb()->routePost("skip-tutorial", "DeveloperDashboardController@postSkipTutorial");
15
+    cb()->routeGet("/", "DeveloperDashboardController@getIndex");
16 16
 });
17 17
 
18 18
 // Developer Auth Middleware
19 19
 Route::group(['middleware' => ['web'],
20 20
     'prefix'=>"developer/".getSetting('developer_path'),
21
-    'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
22
-    cb()->routePost("login","AdminAuthController@postLoginDeveloper");
23
-    cb()->routeGet("login","AdminAuthController@getLoginDeveloper");
24
-    cb()->routeGet("logout","AdminAuthController@getLogoutDeveloper");
21
+    'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
22
+    cb()->routePost("login", "AdminAuthController@postLoginDeveloper");
23
+    cb()->routeGet("login", "AdminAuthController@getLoginDeveloper");
24
+    cb()->routeGet("logout", "AdminAuthController@getLogoutDeveloper");
25 25
 });
26 26
 
27 27
 // Routing without any middleware
28
-Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function () {
29
-    if(env("CB_AUTO_REDIRECT_TO_LOGIN")) {
30
-        cb()->routeGet("/","AdminAuthController@getRedirectToLogin");
28
+Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function() {
29
+    if (env("CB_AUTO_REDIRECT_TO_LOGIN")) {
30
+        cb()->routeGet("/", "AdminAuthController@getRedirectToLogin");
31 31
     }
32 32
 });
33 33
 
34 34
 // Routing without any middleware with admin prefix
35
-Route::group(['middleware' => ['web'], 'prefix' => env('CB_ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function () {
35
+Route::group(['middleware' => ['web'], 'prefix' => env('CB_ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function() {
36 36
     cb()->routeGet('logout', "AdminAuthController@getLogout");
37 37
 
38
-    if(!env("CB_DISABLE_LOGIN")) {
38
+    if (!env("CB_DISABLE_LOGIN")) {
39 39
         cb()->routePost('login', "AdminAuthController@postLogin");
40 40
         cb()->routeGet('login', "AdminAuthController@getLogin");
41 41
     }
42 42
 });
43 43
 
44 44
 // Routing package controllers
45
-cb()->routeGroupBackend(function () {
45
+cb()->routeGroupBackend(function() {
46 46
     cb()->routeController('profile', '\crocodicstudio\crudbooster\controllers\AdminProfileController');
47 47
 });
48 48
 
@@ -51,24 +51,24 @@  discard block
 block discarded – undo
51 51
     'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBBackend::class],
52 52
     'prefix' => env('CB_ADMIN_PATH'),
53 53
     'namespace' => 'App\Http\Controllers',
54
-], function () {
54
+], function() {
55 55
 
56 56
     if (Request::is(env('CB_ADMIN_PATH'))) {
57
-        if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
57
+        if ($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
58 58
             cb()->routeGet("/", $dashboard);
59
-        }else{
59
+        } else {
60 60
             cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex");
61 61
         }
62 62
     }
63 63
 
64 64
     $controllers = glob(app_path('Http/Controllers/Admin*Controller.php'));
65 65
 
66
-    foreach($controllers as $controller) {
66
+    foreach ($controllers as $controller) {
67 67
         $controllerName = basename($controller);
68
-        $controllerName = rtrim($controllerName,".php");
68
+        $controllerName = rtrim($controllerName, ".php");
69 69
         $className = '\App\Http\Controllers\\'.$controllerName;
70 70
         $controllerClass = new $className();
71
-        if(method_exists($controllerClass, 'cbInit')) {
71
+        if (method_exists($controllerClass, 'cbInit')) {
72 72
             cb()->routeController($controllerClass->getData('permalink'), $controllerName);
73 73
         }
74 74
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     if (Request::is(env('CB_ADMIN_PATH'))) {
57 57
         if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) {
58 58
             cb()->routeGet("/", $dashboard);
59
-        }else{
59
+        } else{
60 60
             cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex");
61 61
         }
62 62
     }
Please login to merge, or discard this patch.