@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function handle() |
57 | 57 | { |
58 | - $file = preg_split( " (/|\\\\) ", (string)$this->argument('name')) ?? []; |
|
58 | + $file = preg_split(" (/|\\\\) ", (string) $this->argument('name')) ?? []; |
|
59 | 59 | |
60 | 60 | $this->repoName = $file[count($file) - 1]; |
61 | 61 | unset($file[count($file) - 1]); |
62 | 62 | $path = implode("/", $file); |
63 | 63 | |
64 | - $model= str_plural(\Config::get('repository.model')); |
|
65 | - $interface= str_plural(\Config::get('repository.interface')); |
|
66 | - $repository= str_plural(\Config::get('repository.repository')); |
|
64 | + $model = str_plural(\Config::get('repository.model')); |
|
65 | + $interface = str_plural(\Config::get('repository.interface')); |
|
66 | + $repository = str_plural(\Config::get('repository.repository')); |
|
67 | 67 | |
68 | 68 | $this->generate($path, 'Http\Controllers', 'Controller'); |
69 | 69 | $this->generate($path, $model, 'Entity'); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->generate($path, $interface, 'Interface'); |
72 | 72 | $this->generate($path, $repository, 'Repository'); |
73 | 73 | |
74 | - File::append(\Config::get('repository.route_path') . '/web.php', "\n" . 'Route::resource(\'' . strtolower(str_plural($this->repoName)) . "', '".$path."\\".$this->repoName."Controller');"); |
|
74 | + File::append(\Config::get('repository.route_path') . '/web.php', "\n" . 'Route::resource(\'' . strtolower(str_plural($this->repoName)) . "', '" . $path . "\\" . $this->repoName . "Controller');"); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -104,20 +104,20 @@ discard block |
||
104 | 104 | $this->repoName, |
105 | 105 | str_plural($folder), |
106 | 106 | $path, |
107 | - str_plural(\Config::get('repository.model','Entity')), |
|
108 | - str_plural(\Config::get('repository.interface','Interface')), |
|
107 | + str_plural(\Config::get('repository.model', 'Entity')), |
|
108 | + str_plural(\Config::get('repository.interface', 'Interface')), |
|
109 | 109 | |
110 | 110 | ], |
111 | 111 | $this->getStub($type) |
112 | 112 | ); |
113 | 113 | |
114 | - $folder = str_replace('\\','/',$folder); |
|
114 | + $folder = str_replace('\\', '/', $folder); |
|
115 | 115 | $filePath = $this->getFolderOrCreate(\Config::get('repository.app_path') . "/{$folder}/{$path}/"); |
116 | 116 | |
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 | } |