parent
4f4d0c266a
commit
282cb4be95
@ -243,9 +243,11 @@ 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
|
||||||
DB::table('role_user')->where('user_id', $id)->delete();
|
if (!empty($request->input('roles'))) {
|
||||||
foreach ($request->input('roles') as $key => $value) {
|
DB::table('role_user')->where('user_id', $id)->delete();
|
||||||
$user->attachRole($value);
|
foreach ($request->input('roles') as $key => $value) {
|
||||||
|
$user->attachRole($value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Flash::success('User updated successfully.');
|
Flash::success('User updated successfully.');
|
||||||
|
Loading…
Reference in New Issue
Block a user