original_string: public function attributesToCarbon($event)
      {
          foreach ($this->attributes as $attribute) {
              $value = $this->owner->$attribute;
              if (!empty($value)) {
                  // If this value is an integer, we will assume it is a UNIX timestamp's value
                  // and format a Carbon object from this timestamp.
                  if (is_numeric($value)) {
                      $this->owner->$attribute = Carbon::createFromTimestamp($value);
                  }
  
                  // If the value is in simply year, month, day format, we will instantiate the
                  // Carbon instances from that format.
                  elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $value)) {
                      $this->owner->$attribute = Carbon::createFromFormat('Y-m-d', $value)->startOfDay();
                  } else {
                      $this->owner->$attribute = Carbon::createFromFormat($this->dateFormat, $this->owner->$attribute);
                  }
              }
          }
      }
code: public function attributesToCarbon($event)
      {
          foreach ($this->attributes as $attribute) {
              $value = $this->owner->$attribute;
              if (!empty($value)) {
                  // If this value is an integer, we will assume it is a UNIX timestamp's value
                  // and format a Carbon object from this timestamp.
                  if (is_numeric($value)) {
                      $this->owner->$attribute = Carbon::createFromTimestamp($value);
                  }
  
                  // If the value is in simply year, month, day format, we will instantiate the
                  // Carbon instances from that format.
                  elseif (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $value)) {
                      $this->owner->$attribute = Carbon::createFromFormat('Y-m-d', $value)->startOfDay();
                  } else {
                      $this->owner->$attribute = Carbon::createFromFormat($this->dateFormat, $this->owner->$attribute);
                  }
              }
          }
      }
code_tokens: public function attributesToCarbon ( $ event ) { foreach ( $ this -> attributes as $ attribute ) { $ value = $ this -> owner -> $ attribute ; if ( ! empty ( $ value ) ) { // If this value is an integer, we will assume it is a UNIX timestamp's value // and format a Carbon object from this timestamp. if ( is_numeric ( $ value ) ) { $ this -> owner -> $ attribute = Carbon :: createFromTimestamp ( $ value ) ; } // If the value is in simply year, month, day format, we will instantiate the // Carbon instances from that format. elseif ( preg_match ( '/^(\d{4})-(\d{2})-(\d{2})$/' , $ value ) ) { $ this -> owner -> $ attribute = Carbon :: createFromFormat ( 'Y-m-d' , $ value ) -> startOfDay ( ) ; } else { $ this -> owner -> $ attribute = Carbon :: createFromFormat ( $ this -> dateFormat , $ this -> owner -> $ attribute ) ; } } } }
docstring: Convert the model's attributes to an Carbon instance.
  
  @param $event
  
  @return static
docstring_tokens: Convert the model s attributes to an Carbon instance .