浏览代码

Update UserObserver

Daniel Supernault 2 年之前
父节点
当前提交
796e374040
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/Observers/UserObserver.php

+ 4 - 0
app/Observers/UserObserver.php

@@ -26,6 +26,10 @@ class UserObserver
 			return;
 		}
 
+        if(Profile::whereUsername($user->username)->exists()) {
+            return;
+        }
+
 		if (empty($user->profile)) {
 			$profile = DB::transaction(function() use($user) {
 				$profile = new Profile();