浏览代码

detach all vouchers from the user when deleting the user

AVMG20 4 年之前
父节点
当前提交
348868d6bd
共有 1 个文件被更改,包括 2 次插入0 次删除
  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}");
             Pterodactyl::client()->delete("/application/users/{$user->pterodactyl_id}");
         });
         });
     }
     }