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

Create a ServiceProvider and bind a UserInterface to your repository. You can then $userRepo = App::make('UserInterface'); anywhere.

Last updated 8 months ago.
0

Cool, it works doing it with make! One question, doing App::make() obviously removes the type hinting and my editor can't see my repos functions. And I found I now really miss it since I have a lot of long function names on my repos. Is there any way to type hint or get it working with this approach?

Last updated 8 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

KarlPi karlpi Joined 20 Mar 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.

© 2023 Laravel.io - All rights reserved.