When making a Laravel package, how do I register the service provider and alias of dependency packages?

前端 未结 3 1957
死守一世寂寞
死守一世寂寞 2021-01-31 12:26

I\'m creating a package for Laravel and I\'ve defined the Notification package (https://github.com/edvinaskrucas/notification) as a dependency for my package.

In /workbe

3条回答
  •  星月不相逢
    2021-01-31 12:32

    You can use the alias() method on the app to register an alias, but I would consider having your package users register aliases and service providers themselves in the install process. It's a good way of keeping track of the external code that you're using, and a nice way of pulling components out to test things.

    Personal opinion of course. :)

    Dayle

提交回复
热议问题