public function update($listener, array $input, $id)
    {
        if ((int) $id !== (int) $input['id']) {
            return $listener->userVerificationFailed();
        }

        $validation = $this->validator->on('update')->bind(['roleID' => $id])->with($input);

        if ($validation->fails()) {
            return $listener->updateValidationFailed($validation, $id);
        }

        $role = $this->model->findOrFail($id);

        try {
            $this->saving($role, $input, 'update');
        } catch (Exception $e) {
            return $listener->updateFailed(['error' => $e->getMessage()]);
        }

        return $listener->updateSucceed($role);
    }
public function update($listener, array $input, $id)
    {
        if ((int) $id !== (int) $input['id']) {
            return $listener->userVerificationFailed();
        }

        $validation = $this->validator->on('update')->bind(['roleID' => $id])->with($input);

        if ($validation->fails()) {
            return $listener->updateValidationFailed($validation, $id);
        }

        $role = $this->model->findOrFail($id);

        try {
            $this->saving($role, $input, 'update');
        } catch (Exception $e) {
            return $listener->updateFailed(['error' => $e->getMessage()]);
        }

        return $listener->updateSucceed($role);
    }
public function update ( $ listener , array $ input , $ id ) { if ( ( int ) $ id !== ( int ) $ input [ 'id' ] ) { return $ listener -> userVerificationFailed ( ) ; } $ validation = $ this -> validator -> on ( 'update' ) -> bind ( [ 'roleID' => $ id ] ) -> with ( $ input ) ; if ( $ validation -> fails ( ) ) { return $ listener -> updateValidationFailed ( $ validation , $ id ) ; } $ role = $ this -> model -> findOrFail ( $ id ) ; try { $ this -> saving ( $ role , $ input , 'update' ) ; } catch ( Exception $ e ) { return $ listener -> updateFailed ( [ 'error' => $ e -> getMessage ( ) ] ) ; } return $ listener -> updateSucceed ( $ role ) ; }
Update a role.

@param  object  $listener
@param  array   $input
@param  int     $id

@return mixed
Update a role .