@@ -8,7 +8,7 @@ |
||
8 | 8 | class Model extends BaseGenerator implements GeneratorInterface |
9 | 9 | { |
10 | 10 | private static $destination = "laragen/app/Models"; |
11 | - private static $namespace = "Laragen\App\Models"; |
|
11 | + private static $namespace = "Laragen\App\Models"; |
|
12 | 12 | private static $template = "common/Models/Model"; |
13 | 13 | private static $pivotTemplate = "common/Models/Pivot"; |
14 | 14 |
@@ -9,8 +9,8 @@ |
||
9 | 9 | class Request extends BaseGenerator implements GeneratorInterface |
10 | 10 | { |
11 | 11 | private static $destination = "laragen/app/Http/Requests/Backend"; |
12 | - private static $namespace = "Laragen\App\Http\Requests\Backend"; |
|
13 | - private static $template = "backend/Request"; |
|
12 | + private static $namespace = "Laragen\App\Http\Requests\Backend"; |
|
13 | + private static $template = "backend/Request"; |
|
14 | 14 | |
15 | 15 | public function generate() |
16 | 16 | { |
@@ -7,8 +7,8 @@ |
||
7 | 7 | class Controller extends BaseGenerator implements GeneratorInterface |
8 | 8 | { |
9 | 9 | private static $destination = "laragen/app/Http/Controllers/Backend"; |
10 | - private static $namespace = "Laragen\App\Http\Controllers\Backend"; |
|
11 | - private static $template = "backend/Controller"; |
|
10 | + private static $namespace = "Laragen\App\Http\Controllers\Backend"; |
|
11 | + private static $template = "backend/Controller"; |
|
12 | 12 | |
13 | 13 | public function generate() |
14 | 14 | { |
@@ -64,10 +64,11 @@ |
||
64 | 64 | $itemGenerator = new $generator($module); |
65 | 65 | $returnedFiles = $itemGenerator->generate(); |
66 | 66 | |
67 | - if (!is_array($returnedFiles)) |
|
68 | - $generatedFiles[] = $returnedFiles; |
|
69 | - else |
|
70 | - $generatedFiles = array_merge($generatedFiles, $returnedFiles); |
|
67 | + if (!is_array($returnedFiles)) { |
|
68 | + $generatedFiles[] = $returnedFiles; |
|
69 | + } else { |
|
70 | + $generatedFiles = array_merge($generatedFiles, $returnedFiles); |
|
71 | + } |
|
71 | 72 | |
72 | 73 | // $bar->advance(); |
73 | 74 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | use Illuminate\Support\Str; |
5 | 5 | use Prateekkarki\Laragen\Models\TypeResolver; |
6 | 6 | |
7 | - /** |
|
8 | - * @method integer getSize() |
|
9 | - */ |
|
7 | + /** |
|
8 | + * @method integer getSize() |
|
9 | + */ |
|
10 | 10 | abstract class LaragenType |
11 | 11 | { |
12 | 12 | protected $uniqueFlag; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | { |
78 | 78 | $filteredTypes = []; |
79 | 79 | $options = is_array($options) ? $options : [$options]; |
80 | - foreach($this->getPivotColumns() as $type){ |
|
80 | + foreach ($this->getPivotColumns() as $type) { |
|
81 | 81 | foreach ($options as $option) { |
82 | - if($type->$option()){ |
|
82 | + if ($type->$option()) { |
|
83 | 83 | $filteredTypes[] = $columnsOnly ? $type->getColumn() : $type; |
84 | 84 | break; |
85 | 85 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | public function getForeignKey() |
118 | 118 | { |
119 | - return $this->columnName . "_id"; |
|
119 | + return $this->columnName."_id"; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | public function getRelatedModel() |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | public function getChildModel() |
138 | 138 | { |
139 | - return ucfirst(Str::camel(Str::singular($this->typeOption ?? $this->columnName ))); |
|
139 | + return ucfirst(Str::camel(Str::singular($this->typeOption ?? $this->columnName))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | public function getParentModel() |