I installed tymon/jwt-auth and added "implements JWTSubject" on user class now I am getting error


Please help , I installed tymon/jwt-auth and added "implements JWTSubject" on user class now I am getting error as
Class App\User contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Tymon\JWTAuth\Contracts\JWTSubject::getJWTIdentifier, Tymon\JWTAuth\Contracts\JWTSubject::getJWTCustomClaims)
 
You already invited:

zahirkelloud

Upvotes from:

add the folowing 2 methods in your User model
 
/**
* Get the identifier that will be stored in the subject claim of the JWT.
*
* @return mixed
*/
public function getJWTIdentifier()
{
return $this->getKey();
}

/**
* Return a key value array, containing any custom claims to be added to the JWT.
*
* @return array
*/
public function getJWTCustomClaims()
{
return [];
}

If you wanna answer this question please Login or Register