Ion*_*dru 1 php laravel jwt-auth
我使用本指南制作 jwt-auth https://medium.com/mesan-digital/tutorial-4-how-to-build-a-laravel-5-4-jwt-powered-mobile-app-api-4c59109d35f 当我尝试注册用户时,我发现了这个问题。这是 composer.json 的要求
"require": {
"php": ">=7.1.3",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0",
"tymon/jwt-auth": "1.0.0-rc.1"
},
Run Code Online (Sandbox Code Playgroud)
这是user.php“
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
class User extends Authenticatable implements JWTSubject
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* 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 [];
}
}"
Run Code Online (Sandbox Code Playgroud)
我认为您应该查看此线程,使用此依赖项更新您的 composer.json:
"tymon/jwt-auth": "^1.0.0-beta.3@dev"
Run Code Online (Sandbox Code Playgroud)
并运行composer update。
| 归档时间: |
|
| 查看次数: |
6556 次 |
| 最近记录: |