用户配置转移

This commit is contained in:
2022-11-01 16:39:45 +08:00
parent 719a9ff89d
commit 87e650b2f1
14 changed files with 461 additions and 33 deletions

View File

@@ -30,6 +30,7 @@ class User extends Authenticatable
protected static function boot()
{
parent::boot();
self::created(function ($model) {
$model->info()->create([
'nickname' => '用户'.substr($model->username, -4),
@@ -40,6 +41,7 @@ class User extends Authenticatable
'FaceUrl' => '',
];
app('im')->send('im_open_login_svc', 'account_import', $params);
$model->setting()->create();
});
}
@@ -68,4 +70,9 @@ class User extends Authenticatable
{
return $this->hasOne(UserInfo::class);
}
public function setting(): HasOne
{
return $this->hasOne(UserSetting::class);
}
}