diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index 24bc859204..c8e580273a 100755 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -247,9 +247,10 @@ class UsersController extends Controller } } - } catch (UserNotFoundException $e) { - $error = trans('admin/users/message.user_not_found', compact('id')); - return redirect()->route('users.index')->with('error', $error); + + } catch (ModelNotFoundException $e) { + return redirect()->route('users.index') + ->with('error', trans('admin/users/message.user_not_found', compact('id'))) } @@ -257,8 +258,6 @@ class UsersController extends Controller if (Auth::user()->isSuperUser()) { if ($request->has('groups')) { $user->groups()->sync($request->input('groups')); - } else { - $user->groups()->sync(array()); } }