I found my problem.
on config/jwt.php file change following provider :
- NamshiAdapter to Namshi
- IlluminateAuthAdapter to Illuminate
- IlluminateCacheAdapter to Illuminate
then I got this error:
Type error: Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in /Applications/XAMPP/xamppfiles/htdocs/git/jwt-test/vendor/tymon/jwt-auth/src/JWTAuth.php on line 54
I fix it by implement JWTSubject and modify the class:
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
class User extends Authenticatable implements JWTSubject
{
public function getJWTIdentifier()
{
return $this->getKey();
}
public function getJWTCustomClaims()
{
return [];
}
}
use Tymon\JWTAuth\Providers\JWT\NamshiAdapter
or you didn't register it in service provider... maybe it's an older version of that package that doesn't have auto discovery? – lewis4uconfig/jwt.php
– lewis4u