@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function handle() |
| 57 | 57 | { |
| 58 | - $file = explode("/", (string)$this->argument('name')); |
|
| 58 | + $file = explode("/", (string) $this->argument('name')); |
|
| 59 | 59 | |
| 60 | 60 | $this->repoName = $file[count($file) - 1]; |
| 61 | 61 | unset($file[count($file) - 1]); |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | $this->repoNamespace = ''; |
| 66 | 66 | } else { |
| 67 | 67 | $this->repoNamespace = $file[count($file) - 1]; |
| 68 | - $this->repoNamespace = "\\".implode("\\", $file); |
|
| 68 | + $this->repoNamespace = "\\" . implode("\\", $file); |
|
| 69 | 69 | } |
| 70 | - $model= str_plural(\Config::get('repository.model')); |
|
| 71 | - $interface= str_plural(\Config::get('repository.interface')); |
|
| 72 | - $repository= str_plural(\Config::get('repository.repository')); |
|
| 70 | + $model = str_plural(\Config::get('repository.model')); |
|
| 71 | + $interface = str_plural(\Config::get('repository.interface')); |
|
| 72 | + $repository = str_plural(\Config::get('repository.repository')); |
|
| 73 | 73 | |
| 74 | 74 | $this->generate($path, \Config::get('repository.controllers_path'), 'Controller'); |
| 75 | 75 | $this->generate($path, $model, 'Entity'); |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | $this->generate($path, $repository, 'Repository'); |
| 79 | 79 | |
| 80 | 80 | $this->repoNamespace = stripslashes($this->repoNamespace); |
| 81 | - if($this->repoNamespace) |
|
| 82 | - $this->repoNamespace = $this->repoNamespace."\\"; |
|
| 81 | + if ($this->repoNamespace) |
|
| 82 | + $this->repoNamespace = $this->repoNamespace . "\\"; |
|
| 83 | 83 | File::append(\Config::get('repository.route_path') . '/web.php', "\n" . 'Route::resource(\'' . strtolower(str_plural($this->repoName)) . "', '{$this->repoNamespace}{$this->repoName}Controller');"); |
| 84 | 84 | |
| 85 | 85 | } |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | $this->getStub($type) |
| 115 | 115 | ); |
| 116 | 116 | $filePath = $this->checkFolder(\Config::get('repository.app_path') . "/{$folder}/{$path}/"); |
| 117 | - if($type == 'Entity') |
|
| 117 | + if ($type == 'Entity') |
|
| 118 | 118 | { |
| 119 | 119 | file_put_contents($filePath . "{$this->repoName}.php", $template); |
| 120 | - }else |
|
| 120 | + } else |
|
| 121 | 121 | { |
| 122 | 122 | file_put_contents($filePath . "{$this->repoName}{$type}.php", $template); |
| 123 | 123 | } |