Fix inability to set user as non-admin, closes #414
This commit is contained in:
parent
43df6533b0
commit
4eaf858684
2 changed files with 8 additions and 4 deletions
|
@ -143,10 +143,13 @@ class UserController extends Controller
|
|||
{
|
||||
try {
|
||||
$repo = new UserRepository;
|
||||
$user = $repo->update($id, $request->intersect([
|
||||
'email', 'password', 'name_first',
|
||||
'name_last', 'username', 'root_admin',
|
||||
]));
|
||||
$user = $repo->update($id, array_merge(
|
||||
$request->only('root_admin'),
|
||||
$request->intersect([
|
||||
'email', 'password', 'name_first',
|
||||
'name_last', 'username',
|
||||
])
|
||||
));
|
||||
Alert::success('User account was successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
return redirect()->route('admin.users.view', $id)->withErrors(json_decode($ex->getMessage()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue