php - Why is Laravel vendor:publish returning "Unable to locate publishable resources"?
Get the solution ↓↓↓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.
Answer
Solution:
just runphp artisan vendor:publish
and choose the class that you want to publish. it's work for me on Laravel 8
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot use isset() on the result of an expression (you can use "null !== expression" instead)
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.