Overriding an implementation inside the IoC

This example overrides a model with your custom implementation.

Example 2:


Laravel: resolve the logged in user from the IoC container

Behind the scenes, the Auth facade is bound to Illuminate\Auth\AuthManager. Means, you need to resolve the AuthManager.

This example resolve the currently logged in user from the IoC container:

Link to reference: