protected function prepareValue($key, $record)
    {
        $field = $this->fields->first(function (Field $field) use ($key) {
            return in_array($key, (array) $field->column(), true);
        });

        if (method_exists($field, 'prepare')) {
            return $field->prepare($record);
        }

        return $record;
    }
protected function prepareValue($key, $record)
    {
        $field = $this->fields->first(function (Field $field) use ($key) {
            return in_array($key, (array) $field->column(), true);
        });

        if (method_exists($field, 'prepare')) {
            return $field->prepare($record);
        }

        return $record;
    }
protected function prepareValue ( $ key , $ record ) { $ field = $ this -> fields -> first ( function ( Field $ field ) use ( $ key ) { return in_array ( $ key , ( array ) $ field -> column ( ) , true ) ; } ) ; if ( method_exists ( $ field , 'prepare' ) ) { return $ field -> prepare ( $ record ) ; } return $ record ; }
Do prepare work for each field.

@param string $key
@param string $record

@return mixed
Do prepare work for each field .