public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getDates()))
        {
            if ($value)
            {
                $value = $this->fromDateTime($value);
            }
        }

        $this->attributes[$key] = $value;
    }
public function setAttribute($key, $value)
    {
        if (in_array($key, $this->getDates()))
        {
            if ($value)
            {
                $value = $this->fromDateTime($value);
            }
        }

        $this->attributes[$key] = $value;
    }
public function setAttribute ( $ key , $ value ) { if ( in_array ( $ key , $ this -> getDates ( ) ) ) { if ( $ value ) { $ value = $ this -> fromDateTime ( $ value ) ; } } $ this -> attributes [ $ key ] = $ value ; }
Set a given attribute on the relation.

@param  string  $key
@param  mixed   $value
@return void
Set a given attribute on the relation .