@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $this->template = new \Mustache_Engine([ |
35 | 35 | 'delimiters' => '<% %>', |
36 | - 'escape' => function ($value) { |
|
36 | + 'escape' => function($value) { |
|
37 | 37 | return $value; //no escaping. |
38 | 38 | } |
39 | 39 | ]); |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function getMigrationFiles($paths) |
93 | 93 | { |
94 | - return Collection::make($paths)->flatMap(function ($path) { |
|
94 | + return Collection::make($paths)->flatMap(function($path) { |
|
95 | 95 | return $this->files->glob($path.'/*_*.php'); |
96 | - })->filter()->sortBy(function ($file) { |
|
96 | + })->filter()->sortBy(function($file) { |
|
97 | 97 | return $this->getMigrationName($file); |
98 | - })->values()->keyBy(function ($file) { |
|
98 | + })->values()->keyBy(function($file) { |
|
99 | 99 | return $this->getMigrationName($file); |
100 | 100 | })->all(); |
101 | 101 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | { |
145 | 145 | $this->variables['modelName'] = $this->model->name; |
146 | 146 | |
147 | - $this->variables['modelVariable'] = "$" . Str::camel($this->model->name); |
|
147 | + $this->variables['modelVariable'] = "$".Str::camel($this->model->name); |
|
148 | 148 | |
149 | 149 | |
150 | 150 | if ($this->rules) { |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | public function build($stub) |
225 | 225 | { |
226 | 226 | $stub = $this->getStub($stub); |
227 | - if(!empty($stub)) { |
|
227 | + if (!empty($stub)) { |
|
228 | 228 | return $this->template |
229 | 229 | ->render( |
230 | 230 | $stub, |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | if (starts_with($method, 'build')) { |
242 | 242 | if (str_contains($method, "Model")) { |
243 | 243 | $path = app_path($this->model->name); |
244 | - if($this->files->exists("$path.php")) { |
|
244 | + if ($this->files->exists("$path.php")) { |
|
245 | 245 | $this->messages[] = "File {$this->model->name}.php already exists."; |
246 | 246 | return $this; |
247 | 247 | } |
248 | 248 | } elseif (str_contains($method, "ApiController")) { |
249 | 249 | $path = app_path("Http/Controllers/Api/".$this->model->name."Controller"); |
250 | - if($this->files->exists("$path.php")) { |
|
250 | + if ($this->files->exists("$path.php")) { |
|
251 | 251 | $this->messages[] = "File {$this->model->name}Controller.php already exists."; |
252 | 252 | return $this; |
253 | 253 | } |
@@ -255,25 +255,25 @@ discard block |
||
255 | 255 | $this->files->makeDirectory(app_path("Http/Controllers/Web"), 0755, false, true); |
256 | 256 | } elseif (str_contains($method, "Request")) { |
257 | 257 | $path = app_path("Http/Requests/".$this->model->name."Request"); |
258 | - if($this->files->exists("$path.php")) { |
|
258 | + if ($this->files->exists("$path.php")) { |
|
259 | 259 | $this->messages[] = "File {$this->model->name}Request.php already exists."; |
260 | 260 | return $this; |
261 | 261 | } |
262 | 262 | } else { |
263 | 263 | $path = app_path(); |
264 | - if($this->files->exists("$path.php")) { |
|
264 | + if ($this->files->exists("$path.php")) { |
|
265 | 265 | $this->messages[] = "File {$this->model->name}.php already exists."; |
266 | 266 | return $this; |
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
270 | - if($this->files->exists("$path.php")) { |
|
270 | + if ($this->files->exists("$path.php")) { |
|
271 | 271 | $this->messages[] = "File {$this->model->name}Controller already exists."; |
272 | 272 | return $this; |
273 | 273 | } |
274 | 274 | $target = substr($method, 5); |
275 | 275 | $content = $this->build($target); |
276 | - if($content) { |
|
276 | + if ($content) { |
|
277 | 277 | $this->files->put("$path.php", $content); |
278 | 278 | } else { |
279 | 279 | $this->messages[] = "File stub $target not found."; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | |
286 | 286 | protected function getStub($stub) |
287 | 287 | { |
288 | - if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
288 | + if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
289 | 289 | return $this->files->get(app_path("Scaffold/stubs/$stub.stub")); |
290 | 290 | } else { |
291 | 291 | return false; |