Explorar o código

admins shouldnt delete themselves

1day2die %!s(int64=2) %!d(string=hai) anos
pai
achega
8e1812c1d6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Http/Controllers/ProfileController.php

+ 1 - 1
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();