Browse Source

allow editing name of member and admin. should be fine. we are using IDs

1day2die 2 years ago
parent
commit
c9c991d164
1 changed files with 12 additions and 12 deletions
  1. 12 12
      app/Http/Controllers/Admin/RoleController.php

+ 12 - 12
app/Http/Controllers/Admin/RoleController.php

@@ -106,26 +106,26 @@ class RoleController extends Controller
             }
         }
 
-        if($role->id == 1 || $role->id == 3 || $role->id == 4){ //dont let the user change the names of these roles
-            $role->update([
-                'color' => $request->color
-            ]);
-        }else{
+        //if($role->id == 1 || $role->id == 3 || $role->id == 4){ //dont let the user change the names of these roles
+        //    $role->update([
+        //        'color' => $request->color
+        //    ]);
+        //}else{
             $role->update([
                 'name' => $request->name,
                 'color' => $request->color
             ]);
-        }
+        //}
 
-        if($role->id == 1){
-            return redirect()->route('admin.roles.index')->with('success', __('Role updated. Name and Permissions of this Role cannot be changed'));
-        }elseif($role->id == 4 || $role->id == 3){
-            return redirect()->route('admin.roles.index')->with('success', __('Role updated. Name of this Role cannot be changed'));
-        }else{
+        //if($role->id == 1){
+        //    return redirect()->route('admin.roles.index')->with('success', __('Role updated. Name and Permissions of this Role cannot be changed'));
+        //}elseif($role->id == 4 || $role->id == 3){
+        //    return redirect()->route('admin.roles.index')->with('success', __('Role updated. Name of this Role cannot be changed'));
+       // }else{
             return redirect()
                 ->route('admin.roles.index')
                 ->with('success', __('Role saved'));
-        }
+        //}
     }
 
     /**