Support the ongoing development of Laravel.io →
posted 9 years ago
IOC

If I write this for example:

class MyController { private $test; public function __construct(InterfaceA $test) { $this->test = $test; } }

Is it possible to app bind InterfaceA based on a route?

Is this considered good practice? Or do I bind one classname for the whole app?

Last updated 3 years ago.
0
Solution

This forum is alive

0

Sign in to participate in this thread!

Eventy

Your banner here too?

rstef rstef Joined 7 Aug 2015

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.

© 2025 Laravel.io - All rights reserved.