Issue
I develop the Laravel package and I want to use Repository Pattern and put services in it and then inject this Repository to my Controller.
Pay attention that I need a solution in package development.
Solution
you may define the provider in the extra section of your package's composer.json file. In addition to service providers, you may also list any facades you would like to be registered:
"extra": {
"laravel": {
"providers": [
"Barryvdh\\Debugbar\\ServiceProvider"
],
"aliases": {
"Debugbar": "Barryvdh\\Debugbar\\Facade"
}
}
},
source: https://laravel.com/docs/9.x/packages#package-discovery
Answered By - Meysam M Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.