Explorar el Código

Update AuthLogin listener

Daniel Supernault hace 6 años
padre
commit
abc738a532
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      app/Listeners/AuthLogin.php

+ 5 - 0
app/Listeners/AuthLogin.php

@@ -25,6 +25,11 @@ class AuthLogin
     public function handle($event)
     {
         $user = $event->user;
+
+        if(!$user) {
+            return;
+        }
+
         if (empty($user->settings)) {
             DB::transaction(function() use($user) {
                 UserSetting::firstOrCreate([