Hello All,
I am using PHPSpec to test my classes, therefore I've been trying to inject everything via constructor, or setter injection instead of using Facades everywhere. However my problem is that I couldn't figure out a proper way of injecting the Config Repository. I tried to inject \Illuminate\Config\Repository in my constructors but it always produced an error in the Container. The error is: Target [Illuminate\Config\LoaderInterface] is not instantiable.
I found this relevant article: http://forumsarchive.laravel.io/viewtopic.php?id=15810. There is a work around for this. I am just wondering whether there is a better of doing things.
you could install benconstable/phpspec-laravel and then all Laravel aliases will become available in your specs
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community