Support the ongoing development of Laravel.io →
posted 10 years ago
IOC
Last updated 2 years ago.
0

You cannot create an instance of an interface using new. Try resolving the interface through IOC binding, i.e, $this->app->make('InterfaceName'); .

Last updated 2 years ago.
0

Ah, I somehow thought that the bindings would "overwrite" the Interface classes, but that is clearly not the case. It worked just fine when I resolved the interfaces with $this->app->make instead.

Thanks for clearing that up for me :-)

Last updated 2 years ago.
0

No problem you are welcome :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mengidd mengidd Joined 1 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.