When I use Env in the class injected by the provider, the build fails #1442
-
There will be an error like the above My solution:
I can solve it through the constructor, but is there a better way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Well, the entire point of Service providers and Dependency injection is to not have hard dependencies |
Beta Was this translation helpful? Give feedback.
-
Thanks. I get it ,I didn't understand the meaning of provider |
Beta Was this translation helpful? Give feedback.
Well, the entire point of Service providers and Dependency injection is to not have hard dependencies
import statements
. If you don't want to use DI, then why are you even creating a service provider at first place?