Ncls
3 years ago
134
2
Laravel

Publishing config and migrations from included package in Laravel

Posted 3 years ago by Ncls

I'm using Laravel to build a package which will include some Admin functionality and will include some other packages.

I have included a package which has migrations and a config file, But how do I copy those to the correct folder in Laravel. The package has it's own ServiceProvider but How do I call that from my package?

I'm using the following to register the package in my package.

class CldServiceProvider extends ServiceProvider {

    public function register()
    {
       $this->app->register(MediaLibraryServiceProvider::class);
    }
}

I've tried

php artisan vendor:publish

But it says there's nothing to publish. Because it's only looking at the packages for this Laravel installation, and not the nested packages.

For example this is the ServiceProvider I need to call from my application https://github.com/spatie/laravel-medialibrary/blob/master/src/MediaLibraryServiceProvider.php

I hope my question is clear, any help would be greatly appreciated!

Please sign in or create an account to participate in this conversation.