Am I missing something? It looks like what you're doing in the example is not DI. It's service location, which is considered as an anti-pattern.
Not to mention you're not doing DI, why do you actually need a plugin/package/extension for DI? Laravel itself is a good IOC container and capable of DI so well. You're actually downgrading yourself if you use what you do in the example.
You're going to have all the issues you mentioned IF you use your package...
Edited: after looking at the source code..it looks like the package is only for the built-in facades such as response, request, files, cache, config, and etc..
still, it's service location..and why do you want to use those facades in this way?
even if you use those built-in classes the way you're using, you will have to chance your code when switching to a new framework since those classes are framework specific classes. Do you mind to explain further?
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us