allow editing name of member and admin. should be fine. we are using IDs
This commit is contained in:
parent
fd2e65f8b3
commit
c9c991d164
1 changed files with 12 additions and 12 deletions
|
@ -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'));
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue