From a5f30b8dbfebdbad1cf8802cfb980ad8d1a11210 Mon Sep 17 00:00:00 2001 From: David Carr Date: Sat, 16 Nov 2024 13:59:04 +0000 Subject: [PATCH] get dynamic path to provider --- src/Commands/Publish/PublishConfigurationCommand.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Commands/Publish/PublishConfigurationCommand.php b/src/Commands/Publish/PublishConfigurationCommand.php index 4ec517a29..156dd3022 100644 --- a/src/Commands/Publish/PublishConfigurationCommand.php +++ b/src/Commands/Publish/PublishConfigurationCommand.php @@ -20,7 +20,7 @@ class PublishConfigurationCommand extends BaseCommand * * @var string */ - protected $description = 'Publish a module\'s config files to the application'; + protected $description = "Publish a module's config files to the application"; public function executeAction($name): void { @@ -36,14 +36,12 @@ public function getInfo(): ?string return 'Publishing module config files ...'; } - /** - * @param string $module - */ - private function getServiceProviderForModule($module): string + private function getServiceProviderForModule(string $module): string { $namespace = $this->laravel['config']->get('modules.namespace'); $studlyName = Str::studly($module); $provider = $this->laravel['config']->get('modules.paths.generator.provider.path'); + $provider = str_replace($this->laravel['config']->get('modules.paths.app_folder'), '', $provider); $provider = str_replace('/', '\\', $provider); return "$namespace\\$studlyName\\$provider\\{$studlyName}ServiceProvider";