getKey(); // TODO: Implement getJWTIdentifier() method. } public function getJWTCustomClaims() { return [ 'role' => 'user' ]; // TODO: Implement getJWTCustomClaims() method. } /** * 设置密码加密 * @param $value * @return string */ public function setPasswordAttribute($value) { file_put_contents('password.log','----'.date('Y-m-d H:i:s').'----'.var_export($value,true).PHP_EOL,FILE_APPEND); $this->attributes['password'] = bcrypt($value); file_put_contents('password.log','----'.date('Y-m-d H:i:s').'--加密后--'.var_export($this->attributes['password'],true).PHP_EOL,FILE_APPEND); } public function user_info() { return $this->belongsTo(UserInfoModel::class,'id','user_id'); } }