用户配置转移
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user