@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | class CRUDBooster |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * Comma-delimited data output from the child table |
|
| 19 | - */ |
|
| 18 | + * Comma-delimited data output from the child table |
|
| 19 | + */ |
|
| 20 | 20 | public static function echoSelect2Mult($values, $table, $id, $name) { |
| 21 | 21 | $values = explode(",", $values); |
| 22 | 22 | return implode(", ", DB::table($table)->whereIn($id, $values)->pluck($name)->toArray()); |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | @$mime_type = $mime_type[1]; |
| 44 | 44 | if ($mime_type) { |
| 45 | 45 | $filePath = 'uploads/'.$userID.'/'.date('Y-m'); |
| 46 | - Storage::makeDirectory($filePath); |
|
| 47 | - $filename = md5(str_random(5)).'.'.$mime_type; |
|
| 48 | - if (Storage::put($filePath.'/'.$filename, $filedata)) { |
|
| 49 | - self::resizeImage($filePath.'/'.$filename); |
|
| 46 | + Storage::makeDirectory($filePath); |
|
| 47 | + $filename = md5(str_random(5)).'.'.$mime_type; |
|
| 48 | + if (Storage::put($filePath.'/'.$filename, $filedata)) { |
|
| 49 | + self::resizeImage($filePath.'/'.$filename); |
|
| 50 | 50 | |
| 51 | - return $filePath.'/'.$filename; |
|
| 52 | - } |
|
| 51 | + return $filePath.'/'.$filename; |
|
| 52 | + } |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
@@ -374,17 +374,17 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | public static function getCurrentModule() |
| 376 | 376 | { |
| 377 | - $modulepath = self::getModulePath(); |
|
| 377 | + $modulepath = self::getModulePath(); |
|
| 378 | 378 | |
| 379 | - if (Cache::has('moduls_'.$modulepath)) { |
|
| 380 | - return Cache::get('moduls_'.$modulepath); |
|
| 381 | - } else { |
|
| 379 | + if (Cache::has('moduls_'.$modulepath)) { |
|
| 380 | + return Cache::get('moduls_'.$modulepath); |
|
| 381 | + } else { |
|
| 382 | 382 | |
| 383 | - $module = DB::table('cms_moduls')->where('path', self::getModulePath())->first(); |
|
| 383 | + $module = DB::table('cms_moduls')->where('path', self::getModulePath())->first(); |
|
| 384 | 384 | |
| 385 | - //supply modulpath instead of $module incase where user decides to create form and custom url that does not exist in cms_moduls table. |
|
| 386 | - return ($module)?:$modulepath; |
|
| 387 | - } |
|
| 385 | + //supply modulpath instead of $module incase where user decides to create form and custom url that does not exist in cms_moduls table. |
|
| 386 | + return ($module)?:$modulepath; |
|
| 387 | + } |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | public static function getCurrentDashboardId() |
@@ -526,22 +526,22 @@ discard block |
||
| 526 | 526 | |
| 527 | 527 | public static function getModulePath() |
| 528 | 528 | { |
| 529 | - // Check to position of admin_path |
|
| 530 | - if(config("crudbooster.ADMIN_PATH")) { |
|
| 531 | - $adminPathSegments = explode('/', Request::path()); |
|
| 532 | - $no = 1; |
|
| 533 | - foreach($adminPathSegments as $path) { |
|
| 534 | - if($path == config("crudbooster.ADMIN_PATH")) { |
|
| 535 | - $segment = $no+1; |
|
| 536 | - break; |
|
| 537 | - } |
|
| 538 | - $no++; |
|
| 539 | - } |
|
| 540 | - } else { |
|
| 541 | - $segment = 1; |
|
| 542 | - } |
|
| 543 | - |
|
| 544 | - return Request::segment($segment); |
|
| 529 | + // Check to position of admin_path |
|
| 530 | + if(config("crudbooster.ADMIN_PATH")) { |
|
| 531 | + $adminPathSegments = explode('/', Request::path()); |
|
| 532 | + $no = 1; |
|
| 533 | + foreach($adminPathSegments as $path) { |
|
| 534 | + if($path == config("crudbooster.ADMIN_PATH")) { |
|
| 535 | + $segment = $no+1; |
|
| 536 | + break; |
|
| 537 | + } |
|
| 538 | + $no++; |
|
| 539 | + } |
|
| 540 | + } else { |
|
| 541 | + $segment = 1; |
|
| 542 | + } |
|
| 543 | + |
|
| 544 | + return Request::segment($segment); |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | public static function mainpath($path = null) |
@@ -937,19 +937,19 @@ discard block |
||
| 937 | 937 | // } |
| 938 | 938 | // } |
| 939 | 939 | |
| 940 | - public static function findPrimaryKey($table) |
|
| 941 | - { |
|
| 942 | - if(!$table) |
|
| 943 | - { |
|
| 944 | - return 'id'; |
|
| 945 | - } |
|
| 940 | + public static function findPrimaryKey($table) |
|
| 941 | + { |
|
| 942 | + if(!$table) |
|
| 943 | + { |
|
| 944 | + return 'id'; |
|
| 945 | + } |
|
| 946 | 946 | |
| 947 | - $pk = DB::getDoctrineSchemaManager()->listTableDetails($table)->getPrimaryKey(); |
|
| 948 | - if(!$pk) { |
|
| 949 | - return null; |
|
| 950 | - } |
|
| 951 | - return $pk->getColumns()[0]; |
|
| 952 | - } |
|
| 947 | + $pk = DB::getDoctrineSchemaManager()->listTableDetails($table)->getPrimaryKey(); |
|
| 948 | + if(!$pk) { |
|
| 949 | + return null; |
|
| 950 | + } |
|
| 951 | + return $pk->getColumns()[0]; |
|
| 952 | + } |
|
| 953 | 953 | |
| 954 | 954 | public static function newId($table) |
| 955 | 955 | { |