Open jampack opened 7 years ago
composer require tymon/jwt-auth 1.0.0-rc.1
add something just like this config/app.php Tymon\JWTAuth\Providers\LaravelServiceProvider::class,
'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, 'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class,
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
php artisan jwt:secret
last good luck with you , enjoy it!
@kinyou and rest of the document applies the same for newer version? i dont think so.
@akkhan20 yes you are right , the <tymon/jwt-auth 1.0.0-rc.1> version is only use in laravel 5.5+
The 1.0.0-rc.1 version requires you to implement Tymon\JWTAuth\Contracts\JWTSubject on your user model too. You must then add the required methods, which are getJWTIdentifier() and getJWTCustomClaims().
public function getJWTIdentifier()
{
return $this->getKey(); \\ Eloquent Model method
}
public function getJWTCustomClaims()
{
return [];
}
See: #260
is there any documentation available for version 1.0.0-rc.1 if we want to implement the latest version?