Delete the user in a GDPR compatible way (#1151)

* Delete the user in a GDPR compatible way

* Block user from calls

* Style fix
This commit is contained in:
Nabeel S
2021-04-23 10:33:13 -04:00
committed by GitHub
parent f8c7bc31f5
commit 14d0e99a37
15 changed files with 145 additions and 18 deletions

View File

@@ -252,15 +252,12 @@ class UserController extends Controller
public function destroy($id)
{
$user = $this->userRepo->findWithoutFail($id);
if (empty($user)) {
Flash::error('User not found');
return redirect(route('admin.users.index'));
}
$this->userRepo->delete($id);
$this->userSvc->removeUser($user);
Flash::success('User deleted successfully.');
return redirect(route('admin.users.index'));