Reputation: 2907
I am implementing a package in Laravel 7 and using https://github.com/jeroennoten/Laravel-AdminLTE as a reference.
Inside my package I have the following structure
packages/mypackage/src/MyServiceProvider.php
packages/mypackage/config/config.php
This is the the boot method from the serviceprovider
public function boot()
{
if($this->app->runningInConsole()) {
$this->publishes([
$this->loadConfig() => config_path('myconfig.php'),
], 'config');
}
}
And this is the loadConfig() method
private loadConfig() {
return join(DIRECTORY_SEPARATOR, array(
__DIR__,
'..',
'config',
'config.php'
));
}
But when I run the following command from the root of the project, it is not working
php artisan vendor:publish --provider="MyPackage\MyPackageServiceProvider" --tag="config"
I get this error message
Unable to locate publishable resources.
Publishing complete.
Upvotes: 4
Views: 6368
Reputation: 1409
Just run
php artisan vendor:publish --tag=config
and choose the class that you want to publish. it's work for me on
Laravel 10
Upvotes: 0
Reputation: 564
just run php artisan vendor:publish
and choose the class that you want to publish. it's work for me on Laravel 8
Upvotes: 6