Laravel: Conditional Binding of Interfaces in Service Provider Not Working as Expected
I’m working with Laravel (version 11) and trying to conditionally bind an interface (DashboardStrategy
) to different concrete implementations (DashboardWebService
and DashboardApiService
) depending on which controller is being resolved (DashboardWebController
or DashboardApiController
).