routes.php
$api->version('v1', function ($api) {
$api->group(['namespace'=>'App\Api\Controller'],function ($api){
$api->post('user/login','AuthController@authenticate');
$api->group(['middleware'=>'jwt.auth'],function ($api){
$api->get('lessons','LessonsController@index');
});
});
});
Kernel.php
protected $routeMiddleware = [
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'jwt.auth' => Tymon\JWTAuth\Middleware\GetUserFromToken::class,
'jwt.refresh' => Tymon\JWTAuth\Middleware\RefreshToken::class,
];
当我访问lessons路由时报{"message":"Class App\Http\Tymon\JWTAuth\Middleware\GetUserFromToken does not exist","code":-1,"status_code":500},这是什么原因。