parent
4f4d0c266a
commit
282cb4be95
@ -243,10 +243,12 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete all of the roles and then re-attach the valid ones
|
// Delete all of the roles and then re-attach the valid ones
|
||||||
|
if (!empty($request->input('roles'))) {
|
||||||
DB::table('role_user')->where('user_id', $id)->delete();
|
DB::table('role_user')->where('user_id', $id)->delete();
|
||||||
foreach ($request->input('roles') as $key => $value) {
|
foreach ($request->input('roles') as $key => $value) {
|
||||||
$user->attachRole($value);
|
$user->attachRole($value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Flash::success('User updated successfully.');
|
Flash::success('User updated successfully.');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user