src/Warden/Http/Controllers/ApiController.php
public function validatePut($input, $model, $model_name)
    {
        return collect($input)->filter(function ($value, $key) use ($model, $input) {
            // Remove _token
            if (!isset($value) || $key === '_token') {
                return false;
            }

            //Remove values that are the same.
            if (isset($model->$key)) {
                if ($model->$key === $value) {
                    return false;
                }
            }
            // Is there a relation? If there is, unset it.
            if ($this->doesModelRelate($model, $key, $value)) {
                return false;
            }

            // If there is a password field,
            if (((stripos($key, 'password') !== false) || (stripos($key, 'passwd') !== false)) && !empty($model->$key)) {
                if (\Hash::check($value, $model->$key)) {
                    return false;
                } else {
                    $user_model = config('kregel.warden.models.user.model');
                    $user = new $user_model();
                    if (empty($user->hashable)) {
                        $input[$key] = bcrypt($value);

                        return true;
                    }
                }
            }

            return true;
        });
    }
public function validatePut($input, $model, $model_name)
    {
        return collect($input)->filter(function ($value, $key) use ($model, $input) {
            // Remove _token
            if (!isset($value) || $key === '_token') {
                return false;
            }

            //Remove values that are the same.
            if (isset($model->$key)) {
                if ($model->$key === $value) {
                    return false;
                }
            }
            // Is there a relation? If there is, unset it.
            if ($this->doesModelRelate($model, $key, $value)) {
                return false;
            }

            // If there is a password field,
            if (((stripos($key, 'password') !== false) || (stripos($key, 'passwd') !== false)) && !empty($model->$key)) {
                if (\Hash::check($value, $model->$key)) {
                    return false;
                } else {
                    $user_model = config('kregel.warden.models.user.model');
                    $user = new $user_model();
                    if (empty($user->hashable)) {
                        $input[$key] = bcrypt($value);

                        return true;
                    }
                }
            }

            return true;
        });
    }
public function validatePut ( $ input , $ model , $ model_name ) { return collect ( $ input ) -> filter ( function ( $ value , $ key ) use ( $ model , $ input ) { // Remove _token if ( ! isset ( $ value ) || $ key === '_token' ) { return false ; } //Remove values that are the same. if ( isset ( $ model -> $ key ) ) { if ( $ model -> $ key === $ value ) { return false ; } } // Is there a relation? If there is, unset it. if ( $ this -> doesModelRelate ( $ model , $ key , $ value ) ) { return false ; } // If there is a password field, if ( ( ( stripos ( $ key , 'password' ) !== false ) || ( stripos ( $ key , 'passwd' ) !== false ) ) && ! empty ( $ model -> $ key ) ) { if ( \ Hash :: check ( $ value , $ model -> $ key ) ) { return false ; } else { $ user_model = config ( 'kregel.warden.models.user.model' ) ; $ user = new $ user_model ( ) ; if ( empty ( $ user -> hashable ) ) { $ input [ $ key ] = bcrypt ( $ value ) ; return true ; } } } return true ; } ) ; }
This Checks for any values and the _token for csrf and removes it from any
blank values and it also removes the _token from the input. If there is
a password within the request it will compare it to the current hash.

@param $input
@param $model

@return Collection
This Checks for any values and the _token for csrf and removes it from any blank values and it also removes the _token from the input . If there is a password within the request it will compare it to the current hash .