@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function make() { |
44 | - $name = ($this->name)?:ucwords(str_replace("_"," ",$this->table)); |
|
44 | + $name = ($this->name) ?: ucwords(str_replace("_", " ", $this->table)); |
|
45 | 45 | |
46 | 46 | $template = file_get_contents(__DIR__."/../templates/FooBarController.stub"); |
47 | 47 | |
48 | 48 | //Replace table |
49 | - $template = str_replace("{table}",'"'.$this->table.'"', $template); |
|
49 | + $template = str_replace("{table}", '"'.$this->table.'"', $template); |
|
50 | 50 | |
51 | 51 | //Replace permalink |
52 | 52 | $template = str_replace("{permalink}", '"'.$this->table.'"', $template); |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | //Replace scaffolding |
58 | 58 | $fields = DB::getSchemaBuilder()->getColumnListing($this->table); |
59 | 59 | $primaryKey = cb()->findPrimaryKey($this->table); |
60 | - $exceptions = [$primaryKey,'created_at','updated_at']; |
|
60 | + $exceptions = [$primaryKey, 'created_at', 'updated_at']; |
|
61 | 61 | $scaffold = ""; |
62 | - foreach($fields as $field) { |
|
62 | + foreach ($fields as $field) { |
|
63 | 63 | |
64 | - if(in_array($field, $exceptions)) continue; |
|
64 | + if (in_array($field, $exceptions)) continue; |
|
65 | 65 | |
66 | - $fielLabel = ucwords(str_replace("_"," ",$field)); |
|
66 | + $fielLabel = ucwords(str_replace("_", " ", $field)); |
|
67 | 67 | $scaffold .= '$this->addText("'.$fielLabel.'");'."\n\t\t"; |
68 | 68 | } |
69 | 69 | $template = str_replace("{scaffolding}", $scaffold, $template); |
@@ -61,7 +61,9 @@ |
||
61 | 61 | $scaffold = ""; |
62 | 62 | foreach($fields as $field) { |
63 | 63 | |
64 | - if(in_array($field, $exceptions)) continue; |
|
64 | + if(in_array($field, $exceptions)) { |
|
65 | + continue; |
|
66 | + } |
|
65 | 67 | |
66 | 68 | $fielLabel = ucwords(str_replace("_"," ",$field)); |
67 | 69 | $scaffold .= '$this->addText("'.$fielLabel.'");'."\n\t\t"; |