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…
Reference in New Issue