Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Unable to locate publishable resources. #16

Closed
ayophanz opened this issue Mar 22, 2021 · 4 comments
Closed

Unable to locate publishable resources. #16

ayophanz opened this issue Mar 22, 2021 · 4 comments

Comments

@ayophanz
Copy link

after running this php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations" I get that error

@Geowan
Copy link

Geowan commented Jul 27, 2021

Am also facing the same issue.

@parthibd
Copy link

parthibd commented Aug 1, 2021

Same here. Doesn't work with clockwork.

@mabasic
Copy link
Member

mabasic commented Aug 11, 2021

I will have to look into this...

@mabasic
Copy link
Member

mabasic commented Sep 11, 2021

I've found a solution for this.

Add this code in your bootstrap/app.php file under "Register Service Providers":

if (!function_exists('config_path')) {
    /**
     * Get the configuration path.
     *
     * @param string $path
     * @return string
     */
    function config_path($path = '')
    {
        return app()->configPath($path);
    }
}

$app->register(Spatie\MediaLibrary\MediaLibraryServiceProvider::class);

Then run:

php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"

Output:

$ php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"
Copied File [/vendor/spatie/laravel-medialibrary/database/migrations/create_media_table.php.stub] To [/database/migrations/2021_09_11_151255_create_media_table.php]
Publishing complete.

Tested with Laravel Framework Lumen (8.2.4) (Laravel Components ^8.0).

This works now, but will stop working if I update VendorPublishCommand to match the latest Laravel version because of VendorTagPublish being placed inside laravel/framework meaning that you would have to pull entire Laravel framework in your Lumen app just to get that class.

See this line https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Console/VendorPublishCommand.php#L174

I could change the VendorPublishCommand to use a copied version of that file, but the listeners for that command will not work.

Related issues, PRs, etc. :

This means that I will archive this package for good.

If you need to publish resources, you can copy the files manually or use Laravel instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants