Skip to content

Commit 6387fb3

Browse files
Update PluginCreateCommand.php
1 parent 09101c1 commit 6387fb3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Commands/PluginCreateCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ protected function removeUnusedFiles(string $location): void
164164

165165
public function getReplacements(string $replaceText): array
166166
{
167+
$namespace = Str::of($this->replaceNamespace($this->argument('namespace')))->append('\\\\');
168+
167169
return [
168170
'{type}' => 'plugin',
169171
'{types}' => 'plugins',
@@ -177,8 +179,8 @@ public function getReplacements(string $replaceText): array
177179
'{Module}' => Str::of(str_replace('\\\\', '\\', $this->argument('namespace'))),
178180
'{PluginId}' => $this->argument('id'),
179181
'{PluginName}' => ucfirst(str_replace('-', ' ', $this->argument('name'))),
180-
'{PluginNamespace}' => Str::of($this->replaceNamespace($this->argument('namespace')))->append('\\\\'),
181-
'{PluginServiceProvider}' => Str::of($this->replaceNamespace($this->argument('namespace')))->append('\\\\') . 'Providers\\\\' . $this->argument('provider'),
182+
'{PluginNamespace}' => $namespace,
183+
'{PluginServiceProvider}' => $namespace . 'Providers\\\\' . $this->argument('provider'),
182184
'{PluginAuthor}' => $this->argument('author'),
183185
'{PluginAuthorURL}' => $this->argument('author_url'),
184186
'{PluginVersion}' => $this->argument('version'),

0 commit comments

Comments
 (0)