@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
8 | 8 | { |
9 | - const CONFIG_PATH = __DIR__ . '/../config/scaffold.php'; |
|
9 | + const CONFIG_PATH = __DIR__.'/../config/scaffold.php'; |
|
10 | 10 | |
11 | 11 | public function boot() |
12 | 12 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->buildRequest() |
69 | 69 | ->buildApiController() |
70 | 70 | ->addRoutes(); |
71 | - foreach($scaffold->messages as $message) { |
|
71 | + foreach ($scaffold->messages as $message) { |
|
72 | 72 | $this->info($message); |
73 | 73 | } |
74 | 74 | } |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | $files = $finder->files() |
82 | 82 | ->name('*table.php') |
83 | 83 | ->notName('2014*') |
84 | - ->in(database_path() . '/migrations'); |
|
84 | + ->in(database_path().'/migrations'); |
|
85 | 85 | |
86 | 86 | foreach ($files as $file) { |
87 | - $this->migrations[] = $file->getRealPath() ; |
|
87 | + $this->migrations[] = $file->getRealPath(); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
@@ -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) { |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | { |
226 | 226 | $stub = $this->getStub($stub); |
227 | 227 | dd($stub); |
228 | - if($stub) { |
|
228 | + if ($stub) { |
|
229 | 229 | return $this->template |
230 | 230 | ->render( |
231 | 231 | $this->getStub($stub), |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | if (starts_with($method, 'build')) { |
243 | 243 | if (str_contains($method, "Model")) { |
244 | 244 | $path = app_path($this->model->name); |
245 | - if($this->files->exists($path)) { |
|
245 | + if ($this->files->exists($path)) { |
|
246 | 246 | $this->messages[] = "File {$this->model->name} already exists."; |
247 | 247 | return $this; |
248 | 248 | } |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | $path = app_path(); |
257 | 257 | } |
258 | 258 | |
259 | - if($this->files->exists($path)) { |
|
259 | + if ($this->files->exists($path)) { |
|
260 | 260 | $this->messages[] = "File {$this->model->name}Controller already exists."; |
261 | 261 | return $this; |
262 | 262 | } |
263 | 263 | $target = substr($method, 5); |
264 | 264 | $content = $this->build($target); |
265 | - if($content) { |
|
265 | + if ($content) { |
|
266 | 266 | $this->files->put("$path.php", $content); |
267 | 267 | } else { |
268 | 268 | $this->messages[] = "File stub $target not found."; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | protected function getStub($stub) |
276 | 276 | { |
277 | - if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
277 | + if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
278 | 278 | return $this->files->get(app_path("Scaffold/stubs/$stub.stub")); |
279 | 279 | } else { |
280 | 280 | return false; |