@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | return $fullFilePath; |
25 | 25 | } |
26 | 26 | |
27 | - protected function getFileUploads(){ |
|
27 | + protected function getFileUploads() { |
|
28 | 28 | $fileUploads = ""; |
29 | 29 | $fileFields = $this->module->getFileColumns(); |
30 | - if(empty($fileFields)) return ""; |
|
31 | - if(count($fileFields)>1){ |
|
30 | + if (empty($fileFields)) return ""; |
|
31 | + if (count($fileFields) > 1) { |
|
32 | 32 | $fileUploads .= $this->buildTemplate('backend/fragments/upload-process', [ |
33 | 33 | '{{modelNameLowercase}}' => $this->module->getModelNameLowercase(), |
34 | 34 | '{{fileFields}}' => implode('", "', $fileFields), |
35 | 35 | ]); |
36 | - }else{ |
|
36 | + } else { |
|
37 | 37 | $fileField = $fileFields[0]; |
38 | 38 | $fileUploads .= 'if ($request->has("'.$fileField.'")) {'.PHP_EOL; |
39 | 39 | $fileUploads .= $this->getTabs(3).'$this->uploader->process($request->input("'.$fileField.'"), "category");'.PHP_EOL; |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | return $fileUploads; |
43 | 43 | } |
44 | 44 | |
45 | - protected function getForeignData(){ |
|
45 | + protected function getForeignData() { |
|
46 | 46 | $foreignData = ""; |
47 | 47 | $parents = $this->module->getForeignData(); |
48 | - foreach($parents as $parent){ |
|
48 | + foreach ($parents as $parent) { |
|
49 | 49 | $foreignData .= "'".$parent['parentModule']."' => ".$parent['parentModel']."::all()"; |
50 | - $foreignData .= ($parent==last($parents)) ? '' : ', '; |
|
50 | + $foreignData .= ($parent == last($parents)) ? '' : ', '; |
|
51 | 51 | } |
52 | 52 | return $foreignData; |
53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public function getFileExtentionData() |
71 | 71 | { |
72 | 72 | $controller_ = ''; |
73 | - foreach($this->module->getFileColumns('file') as $column){ |
|
73 | + foreach ($this->module->getFileColumns('file') as $column) { |
|
74 | 74 | $controller_ = "$".$this->module->getModelNameLowercase()."['".$column."_extention'] =".' getFileExtention($'.$this->module->getModelNameLowercase()."->".$column.");"; |
75 | 75 | } |
76 | 76 | return $controller_; |
@@ -27,13 +27,15 @@ |
||
27 | 27 | protected function getFileUploads(){ |
28 | 28 | $fileUploads = ""; |
29 | 29 | $fileFields = $this->module->getFileColumns(); |
30 | - if(empty($fileFields)) return ""; |
|
30 | + if(empty($fileFields)) { |
|
31 | + return ""; |
|
32 | + } |
|
31 | 33 | if(count($fileFields)>1){ |
32 | 34 | $fileUploads .= $this->buildTemplate('backend/fragments/upload-process', [ |
33 | 35 | '{{modelNameLowercase}}' => $this->module->getModelNameLowercase(), |
34 | 36 | '{{fileFields}}' => implode('", "', $fileFields), |
35 | 37 | ]); |
36 | - }else{ |
|
38 | + } else{ |
|
37 | 39 | $fileField = $fileFields[0]; |
38 | 40 | $fileUploads .= 'if ($request->has("'.$fileField.'")) {'.PHP_EOL; |
39 | 41 | $fileUploads .= $this->getTabs(3).'$this->uploader->process($request->input("'.$fileField.'"), "category");'.PHP_EOL; |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | public function generate() |
14 | 14 | { |
15 | 15 | |
16 | - $viewsToBeGenerated = ['index', 'create', 'edit']; |
|
16 | + $viewsToBeGenerated = ['index', 'create', 'edit']; |
|
17 | 17 | |
18 | - $generatedFiles = []; |
|
18 | + $generatedFiles = []; |
|
19 | 19 | |
20 | 20 | foreach ($viewsToBeGenerated as $view) { |
21 | 21 | $viewTemplate = $this->buildTemplate('backend/views/' . $view, [ |
@@ -44,26 +44,26 @@ discard block |
||
44 | 44 | $this->insertIntoFile( |
45 | 45 | $mainMenuFile, |
46 | 46 | '{{-- Main Menu --}}', |
47 | - "\n".'<li class="nav-item dropdown"> |
|
47 | + "\n".'<li class="nav-item dropdown"> |
|
48 | 48 | <a href="#" class="nav-link has-dropdown" data-toggle="dropdown"><i class="fas fa-columns"></i> <span> '.str_plural($this->module->getModelName()).' </span></a> |
49 | 49 | <ul class="dropdown-menu"> |
50 | 50 | <li><a class="nav-link" href="{{ route("backend.'.$this->module->getModuleName().'.create") }}"> Add new '.str_plural($this->module->getModelName()).'</a></li> |
51 | 51 | <li><a class="nav-link" href="{{ route("backend.'.$this->module->getModuleName().'.index") }}">All '.str_plural($this->module->getModelName()).'</a></li> |
52 | 52 | </ul> |
53 | 53 | </li>' |
54 | - ); |
|
54 | + ); |
|
55 | 55 | $generatedFiles = array_merge($generatedFiles, $this->formGenerateCreate()); |
56 | 56 | return $generatedFiles; |
57 | - } |
|
57 | + } |
|
58 | 58 | |
59 | - public function getHeadings(){ |
|
59 | + public function getHeadings(){ |
|
60 | 60 | $columns = $this->module->getBackendColumnTitles(); |
61 | 61 | $headings= ""; |
62 | 62 | foreach ($columns as $column) { |
63 | 63 | $headings .= "<th>".$column."</th>"; |
64 | 64 | } |
65 | - return $headings; |
|
66 | - } |
|
65 | + return $headings; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | public function formGenerateCreate() |
69 | 69 | { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $generatedFiles = []; |
19 | 19 | |
20 | 20 | foreach ($viewsToBeGenerated as $view) { |
21 | - $viewTemplate = $this->buildTemplate('backend/views/' . $view, [ |
|
21 | + $viewTemplate = $this->buildTemplate('backend/views/'.$view, [ |
|
22 | 22 | '{{headings}}' => $this->getHeadings(), |
23 | 23 | '{{moduleDisplayName}}' => $this->module->getModuleDisplayName(), |
24 | 24 | '{{modelNameLowercase}}' => str_singular($this->module->getModuleName()), |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | '{{moduleName}}' => $this->module->getModuleName() |
27 | 27 | ]); |
28 | 28 | |
29 | - $fullFilePath = $this->getPath("resources/views/backend/" . $this->module->getModuleName()) . "/{$view}.blade.php"; |
|
29 | + $fullFilePath = $this->getPath("resources/views/backend/".$this->module->getModuleName())."/{$view}.blade.php"; |
|
30 | 30 | file_put_contents($fullFilePath, $viewTemplate); |
31 | - $generatedFiles[] = $fullFilePath; |
|
31 | + $generatedFiles[] = $fullFilePath; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $mainMenuFile = $this->getPath("resources/views/backend/includes/")."main_menu.blade.php"; |
35 | 35 | |
36 | - if(self::$initializeFlag++ == 0){ |
|
36 | + if (self::$initializeFlag++ == 0) { |
|
37 | 37 | $this->initializeFiles([ |
38 | 38 | $mainMenuFile => "backend/views/includes/main_menu", |
39 | 39 | ]); |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | return $generatedFiles; |
57 | 57 | } |
58 | 58 | |
59 | - public function getHeadings(){ |
|
59 | + public function getHeadings() { |
|
60 | 60 | $columns = $this->module->getBackendColumnTitles(); |
61 | - $headings= ""; |
|
61 | + $headings = ""; |
|
62 | 62 | foreach ($columns as $column) { |
63 | 63 | $headings .= "<th>".$column."</th>"; |
64 | 64 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function formGenerateCreate() |
69 | 69 | { |
70 | 70 | $viewTemplate = ''; |
71 | - foreach($this->module->getData() as $column => $options){ |
|
71 | + foreach ($this->module->getData() as $column => $options) { |
|
72 | 72 | $columnOptions = new DataOption($column, $options); |
73 | 73 | $type = $columnOptions->getType(); |
74 | 74 | $viewTemplate .= $this->buildTemplate('backend/views/formelements/'.$type, [ |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | '{{createElements}}' => $viewTemplate, |
87 | 87 | ]); |
88 | 88 | |
89 | - $formFilePath = $this->getPath("resources/views/backend/" . $this->module->getModuleName()) . "/_form.blade.php"; |
|
89 | + $formFilePath = $this->getPath("resources/views/backend/".$this->module->getModuleName())."/_form.blade.php"; |
|
90 | 90 | file_put_contents($formFilePath, $formTemplate); |
91 | 91 | |
92 | - $generatedFiles[] = $formFilePath; |
|
92 | + $generatedFiles[] = $formFilePath; |
|
93 | 93 | return $generatedFiles; |
94 | 94 | |
95 | 95 | } |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | { |
99 | 99 | $modules = config('laragen.modules'); |
100 | 100 | $displayColumn = ""; |
101 | - if(isset($modules[$parentModule])){ |
|
101 | + if (isset($modules[$parentModule])) { |
|
102 | 102 | $module = $modules[$parentModule]; |
103 | 103 | $module = new Module($parentModule, $module); |
104 | 104 | $displayColumn = $module->getDisplayColumn(); |
105 | 105 | } |
106 | 106 | |
107 | - if ($parentModule=='users'){ |
|
107 | + if ($parentModule == 'users') { |
|
108 | 108 | $displayColumn = 'name'; |
109 | 109 | } |
110 | 110 | return $displayColumn; |
@@ -99,20 +99,20 @@ discard block |
||
99 | 99 | |
100 | 100 | protected function getMultipleSchema($multipleData) |
101 | 101 | { |
102 | - $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
102 | + $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
103 | 103 | $schema .= "\$table->foreign('".$this->module->getModelNameLowercase()."_id')->references('id')->on('".$this->module->getModulename()."')->onDelete('set null');"; |
104 | 104 | |
105 | - foreach($multipleData as $column => $optionString){ |
|
105 | + foreach ($multipleData as $column => $optionString) { |
|
106 | 106 | $option = new DataOption($column, $optionString); |
107 | 107 | $schema .= $option->getSchema(); |
108 | - $schema .= ''.PHP_EOL.$this->getTabs(3); |
|
108 | + $schema .= ''.PHP_EOL.$this->getTabs(3); |
|
109 | 109 | } |
110 | 110 | return $schema; |
111 | 111 | } |
112 | 112 | |
113 | 113 | protected function getPivotSchema($related) |
114 | 114 | { |
115 | - $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
115 | + $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
116 | 116 | $schema .= "\$table->foreign('".$this->module->getModelNameLowercase()."_id')->references('id')->on('".$this->module->getModulename()."')->onDelete('set null');"; |
117 | 117 | |
118 | 118 | $schema .= '$table->bigInteger("'.str_singular($related).'_id")->unsigned()->nullable();'; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | protected function getGallerySchema($gallery) |
125 | 125 | { |
126 | - $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
126 | + $schema = '$table->bigInteger("'.$this->module->getModelNameLowercase().'_id")->unsigned()->nullable();'.PHP_EOL.$this->getTabs(3); |
|
127 | 127 | $schema .= "\$table->foreign('".$this->module->getModelNameLowercase()."_id')->references('id')->on('".$this->module->getModulename()."')->onDelete('set null');"; |
128 | 128 | $schema .= '$table->string("filename", 128);'; |
129 | 129 | $schema .= '$table->timestamps();'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | file_put_contents($fullFilePath, $factoryTemplate); |
24 | 24 | $generatedFiles[] = $fullFilePath; |
25 | 25 | |
26 | - $laragenSeederFile = (self::$initializeFlag++ == 0) ? $this->initializeFile($this->getPath("database/seeds/")."LaragenSeeder.php", 'common/Seeder') : $this->getPath("database/seeds/")."LaragenSeeder.php"; |
|
26 | + $laragenSeederFile = (self::$initializeFlag++ == 0) ? $this->initializeFile($this->getPath("database/seeds/")."LaragenSeeder.php", 'common/Seeder') : $this->getPath("database/seeds/")."LaragenSeeder.php"; |
|
27 | 27 | |
28 | 28 | $this->insertIntoFile( |
29 | 29 | $laragenSeederFile, |
@@ -93,23 +93,23 @@ discard block |
||
93 | 93 | |
94 | 94 | $dataDefinition = ""; |
95 | 95 | foreach ($this->module->getWritableColumns() as $columns) { |
96 | - foreach($columns as $column => $type){ |
|
96 | + foreach ($columns as $column => $type) { |
|
97 | 97 | $specialTypes = array_keys($specialTypesToDefinition); |
98 | - if(in_array($column,$specialTypes)){ |
|
99 | - $dataDefinition .= $this->getTabs(2) . "'{$column}'" . " => " . '$faker->' . $specialTypesToDefinition[$column]; |
|
98 | + if (in_array($column, $specialTypes)) { |
|
99 | + $dataDefinition .= $this->getTabs(2)."'{$column}'"." => ".'$faker->'.$specialTypesToDefinition[$column]; |
|
100 | 100 | } else { |
101 | - $dataDefinition .= $this->getTabs(2) . "'{$column}'" . " => " . '$faker->' . $typeToDefinition[$type]; |
|
101 | + $dataDefinition .= $this->getTabs(2)."'{$column}'"." => ".'$faker->'.$typeToDefinition[$type]; |
|
102 | 102 | } |
103 | 103 | |
104 | - if($column != last($columns)) { |
|
105 | - $dataDefinition .= "," . PHP_EOL; |
|
104 | + if ($column != last($columns)) { |
|
105 | + $dataDefinition .= ",".PHP_EOL; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
109 | 109 | return $dataDefinition; |
110 | 110 | } |
111 | 111 | |
112 | - protected function getForeignData(){ |
|
112 | + protected function getForeignData() { |
|
113 | 113 | $columns = $this->module->getForeignColumns('parent'); |
114 | 114 | |
115 | 115 | $foreignData = ""; |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | '{{parentModel}}' => ucfirst(camel_case(str_singular($parent))) |
122 | 122 | ]); |
123 | 123 | |
124 | - if($column != last($columns)) { |
|
125 | - $foreignData .= "," . PHP_EOL; |
|
124 | + if ($column != last($columns)) { |
|
125 | + $foreignData .= ",".PHP_EOL; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | public function __construct($moduleName, $moduleData) |
14 | 14 | { |
15 | 15 | $this->module = (object) $moduleData; |
16 | - $this->data = array_filter($moduleData, function($elem){ |
|
16 | + $this->data = array_filter($moduleData, function($elem) { |
|
17 | 17 | return (is_array($elem)) ? false : true; |
18 | 18 | }); |
19 | 19 | $this->multipleData = []; |
20 | - $this->multipleData[] = array_filter($moduleData, function($elem){ |
|
20 | + $this->multipleData[] = array_filter($moduleData, function($elem) { |
|
21 | 21 | return (is_array($elem)) ? true : false; |
22 | 22 | }); |
23 | 23 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $data = ['S.N.']; |
48 | 48 | foreach ($this->data as $column => $optionString) { |
49 | 49 | $optionArray = explode('|', $optionString); |
50 | - if (in_array($optionArray[0], ['string', 'int'])&&in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
50 | + if (in_array($optionArray[0], ['string', 'int']) && in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
51 | 51 | $data[] = ucwords($column); |
52 | 52 | } |
53 | 53 | } |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | $data[] = $column; |
65 | 65 | } |
66 | 66 | } |
67 | - if($this->getForeignColumns()){ |
|
68 | - foreach($this->getForeignColumns() as $relation => $tablename ){ |
|
67 | + if ($this->getForeignColumns()) { |
|
68 | + foreach ($this->getForeignColumns() as $relation => $tablename) { |
|
69 | 69 | $columnName = array_values($tablename)[0]; |
70 | 70 | $data[] = str_singular($columnName).'_id'; |
71 | 71 | } |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | foreach ($this->data as $column => $optionString) { |
206 | 206 | $optionArray = explode('|', $optionString); |
207 | - if (in_array($optionArray[0], ['string', 'int'])&&in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
207 | + if (in_array($optionArray[0], ['string', 'int']) && in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
208 | 208 | return $column; |
209 | 209 | } |
210 | 210 | } |
@@ -58,7 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | $data = []; |
60 | 60 | foreach ($this->data as $column => $optionString) { |
61 | - if (is_array($optionString)) continue; |
|
61 | + if (is_array($optionString)) { |
|
62 | + continue; |
|
63 | + } |
|
62 | 64 | $optionArray = explode('|', $optionString); |
63 | 65 | if (in_array($optionArray[0], DataOption::$types)) { |
64 | 66 | $data[] = $column; |
@@ -99,10 +101,11 @@ discard block |
||
99 | 101 | |
100 | 102 | public function getFileColumns($type = 'all') |
101 | 103 | { |
102 | - if (is_array($type)) |
|
103 | - $types = $type; |
|
104 | - else |
|
105 | - $types = ($type == "all") ? DataOption::$fileTypes : [$type]; |
|
104 | + if (is_array($type)) { |
|
105 | + $types = $type; |
|
106 | + } else { |
|
107 | + $types = ($type == "all") ? DataOption::$fileTypes : [$type]; |
|
108 | + } |
|
106 | 109 | |
107 | 110 | $data = []; |
108 | 111 | foreach ($this->data as $column => $optionString) { |
@@ -140,10 +143,11 @@ discard block |
||
140 | 143 | |
141 | 144 | public function getForeignColumns($type = 'all') |
142 | 145 | { |
143 | - if (is_array($type)) |
|
144 | - $types = $type; |
|
145 | - else |
|
146 | - $types = ($type == "all") ? DataOption::$specialTypes : [$type]; |
|
146 | + if (is_array($type)) { |
|
147 | + $types = $type; |
|
148 | + } else { |
|
149 | + $types = ($type == "all") ? DataOption::$specialTypes : [$type]; |
|
150 | + } |
|
147 | 151 | |
148 | 152 | $data = []; |
149 | 153 | foreach ($this->data as $column => $optionString) { |
@@ -157,10 +161,11 @@ discard block |
||
157 | 161 | |
158 | 162 | public function getForeignData($type = 'all') |
159 | 163 | { |
160 | - if (is_array($type)) |
|
161 | - $types = $type; |
|
162 | - else |
|
163 | - $types = ($type == "all") ? DataOption::$specialTypes : [$type]; |
|
164 | + if (is_array($type)) { |
|
165 | + $types = $type; |
|
166 | + } else { |
|
167 | + $types = ($type == "all") ? DataOption::$specialTypes : [$type]; |
|
168 | + } |
|
164 | 169 | |
165 | 170 | $data = []; |
166 | 171 | foreach ($this->data as $column => $optionString) { |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | $this->column = $columnName; |
80 | 80 | $this->size = false; |
81 | 81 | // dump($optionString); |
82 | - if(is_array($optionString) ){ |
|
82 | + if (is_array($optionString)) { |
|
83 | 83 | $this->dataType = 'multiple'; |
84 | 84 | $this->multipleOptions = []; |
85 | - foreach($optionString as $col => $multString){ |
|
85 | + foreach ($optionString as $col => $multString) { |
|
86 | 86 | $this->multipleOptions[] = new Self($col, $multString); |
87 | 87 | } |
88 | 88 | // dd($this->multipleOptions[0]); |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | // dd($column); |
91 | 91 | // $option = ; |
92 | 92 | |
93 | - }else{ |
|
93 | + } else { |
|
94 | 94 | $this->optionArray = explode('|', $optionString); |
95 | 95 | $typePieces = array_shift($this->optionArray); |
96 | 96 | $type = explode(':', $typePieces); |
97 | 97 | $this->dataType = is_array($type) ? $type[0] : $type; |
98 | - $this->typeOption = is_array($type)&&count($type)>=2 ? $type[1] : false; |
|
98 | + $this->typeOption = is_array($type) && count($type) >= 2 ? $type[1] : false; |
|
99 | 99 | |
100 | 100 | foreach ($this->optionArray as $option) { |
101 | 101 | if ($option == self::COLUMN_UNIQUE) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $this->setRequired(); |
107 | 107 | continue; |
108 | 108 | } |
109 | - if(Str::contains($option, ':')){ |
|
109 | + if (Str::contains($option, ':')) { |
|
110 | 110 | $optionPieces = explode(':', $option); |
111 | 111 | $this->setOptions($optionPieces[0], $optionPieces[1]); |
112 | 112 | } |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | |
119 | 119 | public function getSchema() |
120 | 120 | { |
121 | - if ($this->dataType=='parent') { |
|
121 | + if ($this->dataType == 'parent') { |
|
122 | 122 | $schema = $this->processParent(); |
123 | - } else if( in_array($this->dataType, ['gallery', 'related', 'multiple']) ){ |
|
123 | + } else if (in_array($this->dataType, ['gallery', 'related', 'multiple'])) { |
|
124 | 124 | $schema = ''; |
125 | 125 | } else { |
126 | 126 | $schema = '$table->'.$this->getColumnType()."('{$this->column}'"; |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | public function getType() { |
144 | 144 | $type = $this->dataType; |
145 | - if($type=='string'){ |
|
146 | - $type = (!$this->getSize() || $this->getSize()<=128) ? $type : 'text'; |
|
145 | + if ($type == 'string') { |
|
146 | + $type = (!$this->getSize() || $this->getSize() <= 128) ? $type : 'text'; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | return $type; |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | |
168 | 168 | public function getFormOptions() { |
169 | 169 | $options = ""; |
170 | - $options .= $this->isRequired() ? 'required="required" ' :''; |
|
171 | - $options .= $this->getType()=='text' ? 'rows="'.$this->getTextRows().'" ' :''; |
|
170 | + $options .= $this->isRequired() ? 'required="required" ' : ''; |
|
171 | + $options .= $this->getType() == 'text' ? 'rows="'.$this->getTextRows().'" ' : ''; |
|
172 | 172 | return $options; |
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | 176 | public function getTextRows() { |
177 | - if(!$this->size) |
|
177 | + if (!$this->size) |
|
178 | 178 | return 4; |
179 | 179 | |
180 | - return floor($this->getsize()/120); |
|
180 | + return floor($this->getsize() / 120); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | public function getTabs($number) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $this->size = $size; |
222 | 222 | } |
223 | 223 | |
224 | - public function optionArray(){ |
|
224 | + public function optionArray() { |
|
225 | 225 | return $this->optionArray; |
226 | 226 | } |
227 | 227 |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // dd($column); |
91 | 91 | // $option = ; |
92 | 92 | |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | $this->optionArray = explode('|', $optionString); |
95 | 95 | $typePieces = array_shift($this->optionArray); |
96 | 96 | $type = explode(':', $typePieces); |
@@ -174,8 +174,9 @@ discard block |
||
174 | 174 | |
175 | 175 | |
176 | 176 | public function getTextRows() { |
177 | - if(!$this->size) |
|
178 | - return 4; |
|
177 | + if(!$this->size) { |
|
178 | + return 4; |
|
179 | + } |
|
179 | 180 | |
180 | 181 | return floor($this->getsize()/120); |
181 | 182 | } |