Create a ServiceProvider and bind a UserInterface to your repository. You can then $userRepo = App::make('UserInterface'); anywhere.
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?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community