Pārlūkot izejas kodu

Update UserObserver

Daniel Supernault 2 gadi atpakaļ
vecāks
revīzija
796e374040
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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();