Backend\UserGroupsController::update PHP Method

update() public method

Update the specified user groups in storage.
public update ( integer $id ) : Response
$id integer
return Response
    public function update($id)
    {
        try {
            $input = Input::all();
            $validator = Group::validate($input, $id);
            if ($validator->passes()) {
                $group = $this->usergroup_manager->updateUserGroup($id, $input);
                return Redirect::to('backend/user-groups')->with('success_message', trans('success_messages.user_group_update', ['usergroup' => $input['name']]));
            } else {
                // Form validation failed
                return Redirect::back()->withInput()->withErrors($validator);
            }
        } catch (Exception $e) {
            return Redirect::back()->with('error_message', trans('error_messages.user_group_update', ['usergroup' => $input['name']]) . $e->getMessage());
        }
    }