Closed redtusker closed 1 week ago
Hi,
To publish configuration files, you can use the following command:
php artisan module:publish-config
To publish assets, use this command:
php artisan module:publish
Both commands support the --all
option to publish for all modules. You can also specify multiple module names like this:
php artisan module:publish-config Base User Tag
for publish package config,vite-loader and stubs :
php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"
Hi, thanks for replying
I tried those commands but it didn't work the config and migrations are not published
ensure you module contain this function on provider and call on boot
method. and path is correct.
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
reference on module sutb: https://github.com/nWidart/laravel-modules/blob/15dec6bed2826feba9012a59bf08f880ecc9ba7d/src/Commands/stubs/scaffold/provider.stub#L74-L81
Yes the module contain this function on the provider
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
but still its not working as expected and still unable to publish those files
identified the problem, applied a fix, will be doing a release shortly.
unable to vendor publish config and assets and there is no command way to do so
i.e want to run the following but its not working there is no commands for module to do so
php artisan vendor:publish --provider="Spatie\WebhookServer\WebhookServerServiceProvider"