@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function createField($column, $attributes, $type = 'add') |
148 | 148 | { |
149 | - $results = "\t\t\t" . '$table'; |
|
149 | + $results = "\t\t\t".'$table'; |
|
150 | 150 | |
151 | 151 | foreach ($attributes as $key => $field) { |
152 | 152 | if (in_array($column, $this->relationshipKeys)) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - return $results . ';' . PHP_EOL; |
|
159 | + return $results.';'.PHP_EOL; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -170,18 +170,18 @@ discard block |
||
170 | 170 | */ |
171 | 171 | protected function addRelationColumn($key, $field, $column) |
172 | 172 | { |
173 | - if($key == 0) { |
|
174 | - $relatedColumn = snake_case(class_basename($field)) . '_id'; |
|
175 | - return "->integer('{$relatedColumn}')->unsigned();".PHP_EOL."\t\t\t" . "\$table->foreign('{$relatedColumn}')"; |
|
173 | + if ($key == 0) { |
|
174 | + $relatedColumn = snake_case(class_basename($field)).'_id'; |
|
175 | + return "->integer('{$relatedColumn}')->unsigned();".PHP_EOL."\t\t\t"."\$table->foreign('{$relatedColumn}')"; |
|
176 | 176 | } elseif ($key == 1) { |
177 | 177 | return "->references('{$field}')"; |
178 | 178 | } elseif ($key == 2) { |
179 | 179 | return "->on('{$field}')"; |
180 | 180 | } else { |
181 | 181 | if (str_contains($field, '(')) { |
182 | - return '->' . $field; |
|
182 | + return '->'.$field; |
|
183 | 183 | } |
184 | - return '->' . $field . '()'; |
|
184 | + return '->'.$field.'()'; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -197,18 +197,18 @@ discard block |
||
197 | 197 | protected function addColumn($key, $field, $column) |
198 | 198 | { |
199 | 199 | if ($this->hasCustomAttribute($column)) { |
200 | - return '->' . $field; |
|
200 | + return '->'.$field; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | if ($key == 0) { |
204 | - return '->' . $field . "('" . $column . "')"; |
|
204 | + return '->'.$field."('".$column."')"; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | if (Str::contains($field, '(')) { |
208 | - return '->' . $field; |
|
208 | + return '->'.$field; |
|
209 | 209 | } |
210 | 210 | |
211 | - return '->' . $field . '()'; |
|
211 | + return '->'.$field.'()'; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | protected function removeColumn($key, $field, $column) |
224 | 224 | { |
225 | 225 | if ($this->hasCustomAttribute($column)) { |
226 | - return '->' . $field; |
|
226 | + return '->'.$field; |
|
227 | 227 | } |
228 | 228 | |
229 | - return '->dropColumn(' . "'" . $column . "')"; |
|
229 | + return '->dropColumn('."'".$column."')"; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getAttributes($column, $schema) |
253 | 253 | { |
254 | - $fields = str_replace($column . ':', '', $schema); |
|
254 | + $fields = str_replace($column.':', '', $schema); |
|
255 | 255 | |
256 | 256 | return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields); |
257 | 257 | } |