secure() ? "https" : "http"; if (!$this->avatar) { switch ($this->sex) { case "男": $this->avatar = "/images/male.png"; break; case "女": $this->avatar = "/images/female.png"; break; } } return $this->avatar ? $protocol . "://" . request()->getHost() . $this->avatar : $this->avatar; } public function guardName() { return self::GUARD_NAME; } // Rest omitted for brevity /** * 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 []; } /** * The attributes that are mass assignable. * * @var array */ protected $fillable = []; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'verified_at' => 'datetime', ]; }