Fixed user deletion to also delete associated links

https://github.com/LinkStackOrg/LinkStack/issues/576
This commit is contained in:
Julian Prieber 2023-09-20 13:33:51 +02:00
parent ccf5e7ad13
commit 406cd4edb0
1 changed files with 6 additions and 3 deletions

View File

@ -211,12 +211,15 @@ public function SendTestMail(Request $request)
{
$id = $request->id;
$user = User::find($id);
Link::where('user_id', $id)->delete();
Schema::disableForeignKeyConstraints();
$user = User::find($id);
$user->forceDelete();
Schema::enableForeignKeyConstraints();
return redirect('admin/users/all');
}