[更新] 微调
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use App\Models\Traits\HasAccount;
|
||||
use App\Models\Traits\HasArea;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -65,6 +66,16 @@ class User extends Authenticatable
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 为数组 / JSON 序列化准备日期。
|
||||
* @param \DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date)
|
||||
{
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
protected function getNicknameAttribute()
|
||||
{
|
||||
return $this->info ? $this->info->nickname : '';
|
||||
|
||||
Reference in New Issue
Block a user