original_string: public function attributesToDefaultFormat($event)
      {
          $oldAttributes = $this->owner->oldAttributes;
          foreach ($this->attributes as $attribute) {
              $oldAttributeValue = $oldAttributes[$attribute];
  
              if ($this->owner->$attribute instanceof Carbon) {
                  //If old attribute value is an integer, then we convert the current attribute value to the timestamp for prevent db errors
                  if (is_numeric($oldAttributeValue)) {
                      $this->owner->$attribute = $this->owner->$attribute->timestamp;
                  }
              }
          }
      }
code: public function attributesToDefaultFormat($event)
      {
          $oldAttributes = $this->owner->oldAttributes;
          foreach ($this->attributes as $attribute) {
              $oldAttributeValue = $oldAttributes[$attribute];
  
              if ($this->owner->$attribute instanceof Carbon) {
                  //If old attribute value is an integer, then we convert the current attribute value to the timestamp for prevent db errors
                  if (is_numeric($oldAttributeValue)) {
                      $this->owner->$attribute = $this->owner->$attribute->timestamp;
                  }
              }
          }
      }
code_tokens: public function attributesToDefaultFormat ( $ event ) { $ oldAttributes = $ this -> owner -> oldAttributes ; foreach ( $ this -> attributes as $ attribute ) { $ oldAttributeValue = $ oldAttributes [ $ attribute ] ; if ( $ this -> owner -> $ attribute instanceof Carbon ) { //If old attribute value is an integer, then we convert the current attribute value to the timestamp for prevent db errors if ( is_numeric ( $ oldAttributeValue ) ) { $ this -> owner -> $ attribute = $ this -> owner -> $ attribute -> timestamp ; } } } }
docstring: Handles owner 'beforeUpdate' event for converting attributes values to the default format
  
  @param $event
  
  @return bool
docstring_tokens: Handles owner beforeUpdate event for converting attributes values to the default format