When I try to inject AuthManager into a class it throws an Exception.
Steps To Reproduce:
Try to use code like this.
It seems Lumen half registers the component:
Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\\Auth\\AuthManager
The only way I can solve this is by adding:
$this->app->singleton(AuthManager::class, function () {
return $this->app->loadComponent('auth', 'Illuminate\Auth\AuthServiceProvider', 'auth');
});
to my AuthServiceProvider.php.
For some reason the class is half loaded such that it's not throwing that the class isn't registered but also can't return the correct singleton instance without me registering it.
"version": "v7.1.2",
Description:
When I try to inject AuthManager into a class it throws an Exception.
Steps To Reproduce:
Try to use code like this.
It seems Lumen half registers the component:
The only way I can solve this is by adding:
to my
AuthServiceProvider.php
.For some reason the class is half loaded such that it's not throwing that the class isn't registered but also can't return the correct singleton instance without me registering it.
I say half register because it appears in
app()
: