diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 8c90e5e..90bd113 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -122,4 +122,14 @@ public function userroles_assign(Request $request){ return redirect()->route('users-roles.index')->with('success','Sukses Memberi Role User'); } +public function userroles_deassign(Request $request){ + $listUser = $request->input('checkboxes', []); + $listUser = $request->input('checkboxes', []); + foreach($listUser as $listUsers) { + $user = User::find($listUsers); + $user->removeRole($request->roles_user); + } + return redirect()->route('users-roles.index')->with('success','Sukses Memberi Role User'); +} + } diff --git a/resources/views/user/user_roles_index.blade.php b/resources/views/user/user_roles_index.blade.php index 717a316..0f20e60 100644 --- a/resources/views/user/user_roles_index.blade.php +++ b/resources/views/user/user_roles_index.blade.php @@ -80,7 +80,9 @@ {{ $loop->iteration }} {{ $datas->name }} - | + | + | + + + + + +