mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-08 08:08:42 +01:00
Fixed user deletion to also delete associated links
https://github.com/LinkStackOrg/LinkStack/issues/576
This commit is contained in:
parent
ccf5e7ad13
commit
406cd4edb0
@ -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');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user