7 months ago

Conditionally Bind Implementation to Interfaces

Posted 7 months ago by meddle

Hello everyone!

Is there any way to bind (or override existing bindings) implementations to interfaces based on user role?

For example if there is a user with role A, after a successful login, i would like to bind a certain implementation of an interface.

When i tried to register the implementation to my Provider the auth() helper is not available since middlewares and so on, are being loaded after the service provider.

In general is there any way to conditionally bind implementations to interfaces?


Please sign in or create an account to participate in this conversation.