getKey(); // TODO: Implement getJWTIdentifier() method. } public function getJWTCustomClaims() { return [ 'role' => 'user' ]; // TODO: Implement getJWTCustomClaims() method. } protected function serializeDate(\DateTimeInterface $date) { return $date->format($this->dateFormat ?: 'Y-m-d H:i:s'); } /** * 设置密码加密 * @param $value * @return string */ public function setPasswordAttribute($value) { $this->attributes['password'] = bcrypt($value); } public function account(): BelongsTo { return$this->belongsTo(Account::class,'account_id', 'id'); } }