Ver código fonte

detach all vouchers from the user when deleting the user

AVMG20 4 anos atrás
pai
commit
348868d6bd
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      app/Models/User.php

+ 2 - 0
app/Models/User.php

@@ -105,6 +105,8 @@ class User extends Authenticatable implements MustVerifyEmail
                 }
             });
 
+            $user->vouchers()->detach();
+
             Pterodactyl::client()->delete("/application/users/{$user->pterodactyl_id}");
         });
     }