-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BindingResolutionException #6
Comments
Same here |
@podluzhnyi @pedrogaldino gonna check it right now |
@pedrogaldino @pedrogaldino can you explain better where are you triggering this? The Guard instance should be registered on the laravel and it's not instantiable with resolve since it needs some parameters. the other guards, default ones are the same |
@podluzhnyi @pedrogaldino @hernandev - did you guys ever find the cause of this? I'm experiencing this exact same issue on Laravel 5.6 / PHP 7.2. |
Just came back from running some errands - took a fresh look at this, I think I figure out what @hernandev meant - this error went away in my code when I stopped trying to have the Example: // This won't even run - the DI will fail. This is adapted from the current README.md.
public function refreshToken(Guard $auth, Request $request)
{
$token = $auth->refresh();
return response()->json(compact('token'));
} Instead, running the following works: public function refreshToken(Request $request)
{
$token = \Auth::refresh();
return response()->json(compact('token'));
} Once I switched to the latter method, all my tests passed. As such, we probably want to update the README. I'll submit a PR. |
I'm rather new to laravel but this looks kind of fishy to me: laravel-jwt/src/Auth/ServiceProvider.php Lines 42 to 49 in cd5cf11
Is there any reason a fresh guard is returned and not |
@Anticom I have already fixed this in PR #45. This means the next release of the package will be for >= 5.7 only |
After installation strictly according to the instructions, I have a exception:
Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Codecasts\Auth\JWT\Auth\Guard in Container.php (line 910)
Laravel 5.4.28
I did:
The text was updated successfully, but these errors were encountered: