Browse Source

detach all vouchers from the user when deleting the user

AVMG20 4 years ago
parent
commit
348868d6bd
1 changed files with 2 additions and 0 deletions
  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}");
         });
     }