Skip to content

My service provider is not published during install process #121

Closed Answered by dominik-eller
dominik-eller asked this question in Q&A
Discussion options

You must be logged in to vote

I was missing the directive ->publishesServiceProvider('MyProviderName')

I added it to my PackageServiceProvider and now I gets published. Sorry, my bad. Maybe I did not see that in the documentation.

$package
   ->name('package')
   ->publishesServiceProvider('PackageServiceProvider')
   ->hasInstallCommand(function(InstallCommand $command) {
      $command
         ->copyAndRegisterServiceProviderInApp();
   });

both lines (publishesServiceProvider and copyAndRegisterServiceProviderInApp) are required to copy the Provider and registering it in config/app.php.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dominik-eller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant