0

I am creating various Laravel packages, each with their own Service Provider.

A lot of them will need to a bind a Controller from another package I made, but call it with unique parameters.

The issue I'm getting is that, even with the bind in the boot method, App B is binding the controller with the bind from App A's Service Provider.

Is there a way to segregate the binds, so App A binds the controller with it's parameters, and App B binds it with it's own parameters?

Mr Pablo
  • 4,109
  • 8
  • 51
  • 104
  • Is [Contextual Binding](https://laravel.com/docs/5.6/container#contextual-binding) a solution? – online Thomas Aug 31 '18 at 11:20
  • I can't seem to get this working. The examples don't really match up with what I'm trying to do. – Mr Pablo Aug 31 '18 at 12:59
  • So my workaround for now, is when I'm doing the binding, I wrap them in an IF statement to check the host (sub domain) the request comes from. – Mr Pablo Sep 03 '18 at 11:18

0 Answers0