Jwt-auth: BindingResolutionException in Container.php line 752: Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable while building [Tymon\JWTAuth\Middleware\GetUserFromToken].

Created on 27 May 2016  路  5Comments  路  Source: tymondesigns/jwt-auth

Hey guys,

I tried to implement JWT into Lumen, but I got the following error after request a route that requires jwt.auth:

BindingResolutionException in Container.php line 752: Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable while building [Tymon\JWTAuth\Middleware\GetUserFromToken].

I've found https://github.com/tymondesigns/jwt-auth/pull/532 it seemed the same issue, but even if I added the code it has suggested, it still not works.

Is this an issue of the plugin, or am I missing something that causes this problem?:)

Thanks in advance

All 5 comments

I've found the solution. The AppServiceProvider is not used by default, so it should be uncommented:)

After that I had an other error, but it can be solved by https://github.com/tymondesigns/jwt-auth/issues/564

I need help

please help me!!

use Illuminate\Http\Request;

add provider in the config/app.php

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Auth\AuthServiceProvider::class,
    Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,

...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CBR09 picture CBR09  路  3Comments

gandra picture gandra  路  3Comments

functionpointdaniel picture functionpointdaniel  路  3Comments

mihailo-misic picture mihailo-misic  路  3Comments

Rasoul-Karimi picture Rasoul-Karimi  路  3Comments