@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public static function findPK($table) |
| 18 | 18 | { |
| 19 | - if (! $table) { |
|
| 19 | + if (!$table) { |
|
| 20 | 20 | return 'id'; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | $table = CRUDBooster::parseSqlTable($table); |
| 27 | 27 | |
| 28 | - if (! $table['table']) { |
|
| 28 | + if (!$table['table']) { |
|
| 29 | 29 | throw new \Exception("parseSqlTable can't determine the table"); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $primaryKey = self::findPKname($table); |
| 33 | 33 | |
| 34 | - if (! $primaryKey) { |
|
| 34 | + if (!$primaryKey) { |
|
| 35 | 35 | return 'id'; |
| 36 | 36 | } |
| 37 | 37 | CbCache::put('table_'.$table, 'primaryKey', $primaryKey); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $cols = collect(DB::select('SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = :database AND TABLE_NAME = :table', [ |
| 102 | 102 | 'database' => $table['database'], |
| 103 | 103 | 'table' => $table['table'], |
| 104 | - ]))->map(function ($x) { |
|
| 104 | + ]))->map(function($x) { |
|
| 105 | 105 | return (array) $x; |
| 106 | 106 | })->toArray(); |
| 107 | 107 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $field = 'field_type_'.$table.'_'.$field; |
| 119 | 119 | |
| 120 | - return Cache::rememberForever($field, function () use ($table, $field) { |
|
| 120 | + return Cache::rememberForever($field, function() use ($table, $field) { |
|
| 121 | 121 | try { |
| 122 | 122 | //MySQL & SQL Server |
| 123 | 123 | $typedata = DB::select(DB::raw("select DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$table' and COLUMN_NAME = '$field'"))[0]->DATA_TYPE; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | $table = CRUDBooster::getTableForeignKey($fieldName); |
| 145 | - if (! $table) { |
|
| 145 | + if (!$table) { |
|
| 146 | 146 | return false; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | function handle($result, $table) |
| 25 | 25 | { |
| 26 | 26 | $orderby = $this->ctrl->orderby; |
| 27 | - if (! $orderby) { |
|
| 27 | + if (!$orderby) { |
|
| 28 | 28 | $result->orderby($table.'.'.$this->ctrl->primaryKey, 'desc'); |
| 29 | 29 | return; |
| 30 | 30 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $this->table = 'cms_moduls'; |
| 18 | 18 | $this->primaryKey = 'id'; |
| 19 | - $this->title_field = 'name' ; |
|
| 19 | + $this->title_field = 'name'; |
|
| 20 | 20 | $this->limit = 100; |
| 21 | 21 | $this->button_add = false; |
| 22 | 22 | $this->buttonExport = false; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $this->orderby = ['is_protected' => 'asc', 'name' => 'asc']; |
| 29 | 29 | |
| 30 | 30 | $this->col = []; |
| 31 | - $this->col[] = ['label' => 'name', 'name' => 'name' ]; |
|
| 31 | + $this->col[] = ['label' => 'name', 'name' => 'name']; |
|
| 32 | 32 | $this->col[] = ['label' => "Table", 'name' => "table_name"]; |
| 33 | 33 | $this->col[] = ['label' => "Path", 'name' => "path"]; |
| 34 | 34 | $this->col[] = ['label' => "Controller", 'name' => "controller"]; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $this->form[] = ['label' => 'Controller', 'name' => 'controller', 'type' => 'text', 'placeholder' => '(Optional) Auto Generated']; |
| 251 | 251 | |
| 252 | 252 | if (in_array(CRUDBooster::getCurrentMethod(), ['getAdd', 'postAddSave'])) { |
| 253 | - return ; |
|
| 253 | + return; |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | $this->form[] = [ |