Like you can use the php artisan vendor:publish command to push addon assets, there's no way when creating a Statamic addon to set configuration files that can be published.
I thought I found a solution for it but it didn't end up working.
Good find, there's no Statamicy way to do it. But you can still do it the Laravel way.
function boot()
{
parent::boot();
$this->publishes([
__DIR__.'/../config/foo.php' => config_path('foo.php'),
]);
}
@damcclean Do you publish your addon config into the config/statamic subfolder or simply into config? I'm thinking config/statamic makes more sense. Especially when installing Statamic into an existing Laravel app. This way all the Statamic related configs are sorted.
@damcclean Do you publish your addon config into the
config/statamicsubfolder or simply intoconfig? I'm thinkingconfig/statamicmakes more sense. Especially when installing Statamic into an existing Laravel app. This way all the Statamic related configs are sorted.
I just put them in the config folder itself.
I did think about putting it in config/statamic originally but I must have changed my mind 😂 I could always change it.
Yeah, I'm torn too. I'm just thinking that it would be great if all addons followed the same pattern …
Yeah I agree. I was probably just waiting to see what others were going to do.

Put it in the root. We use a directory because we have multiple files and didn’t want to clog the root. But we can’t stop you from putting them wherever you want.
Alright! You da boss! 🤓
Most helpful comment
Put it in the root. We use a directory because we have multiple files and didn’t want to clog the root. But we can’t stop you from putting them wherever you want.