@@ -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 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ->buildRequest() |
70 | 70 | ->buildApiController() |
71 | 71 | ->addRoutes(); |
72 | - foreach($scaffold->messages as $message) { |
|
72 | + foreach ($scaffold->messages as $message) { |
|
73 | 73 | $this->line($message); |
74 | 74 | } |
75 | 75 | } |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | $files = $finder->files() |
83 | 83 | ->name('*table.php') |
84 | 84 | ->notName('2014*') |
85 | - ->in(database_path() . '/migrations'); |
|
85 | + ->in(database_path().'/migrations'); |
|
86 | 86 | |
87 | 87 | foreach ($files as $file) { |
88 | - $this->migrations[] = $file->getRealPath() ; |
|
88 | + $this->migrations[] = $file->getRealPath(); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -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,7 +241,7 @@ 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)) { |
|
244 | + if ($this->files->exists($path)) { |
|
245 | 245 | $this->messages[] = "File {$this->model->name} already exists."; |
246 | 246 | return $this; |
247 | 247 | } |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | $path = app_path(); |
256 | 256 | } |
257 | 257 | |
258 | - if($this->files->exists($path)) { |
|
258 | + if ($this->files->exists($path)) { |
|
259 | 259 | $this->messages[] = "File {$this->model->name}Controller already exists."; |
260 | 260 | return $this; |
261 | 261 | } |
262 | 262 | $target = substr($method, 5); |
263 | 263 | $content = $this->build($target); |
264 | - if($content) { |
|
264 | + if ($content) { |
|
265 | 265 | echo "1"; |
266 | 266 | $this->files->put("$path.php", $content); |
267 | 267 | } else { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | protected function getStub($stub) |
277 | 277 | { |
278 | - if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
278 | + if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) { |
|
279 | 279 | return $this->files->get(app_path("Scaffold/stubs/$stub.stub")); |
280 | 280 | } else { |
281 | 281 | return false; |