From 8e1812c1d67a6136302305c6353b774300bcaddb Mon Sep 17 00:00:00 2001 From: 1day2die Date: Wed, 11 Jan 2023 11:46:29 +0100 Subject: [PATCH] admins shouldnt delete themselves --- app/Http/Controllers/ProfileController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 94bff453..bffbc963 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -42,7 +42,7 @@ class ProfileController extends Controller public function selfDestroyUser() { $user = Auth::user(); - //if ($user->role == "admin") return back()->with("error", "You cannot delete yourself as an admin!"); + if ($user->role == "admin") return back()->with("error", "You cannot delete yourself as an admin!"); $user->delete();