src/DataTransferObject.php
public function getAttribute($key)
    {
        if (! $key) {
            return;
        }

        if (array_key_exists($key, $this->attributes) || $this->hasGetMutator($key)) {
            return $this->getAttributeValue($key);
        }

        if (method_exists(self::class, $key)) {
            return;
        }
    }
public function getAttribute($key)
    {
        if (! $key) {
            return;
        }

        if (array_key_exists($key, $this->attributes) || $this->hasGetMutator($key)) {
            return $this->getAttributeValue($key);
        }

        if (method_exists(self::class, $key)) {
            return;
        }
    }
public function getAttribute ( $ key ) { if ( ! $ key ) { return ; } if ( array_key_exists ( $ key , $ this -> attributes ) || $ this -> hasGetMutator ( $ key ) ) { return $ this -> getAttributeValue ( $ key ) ; } if ( method_exists ( self :: class , $ key ) ) { return ; } }
Get an attribute from the object.

@param  string  $key
@return mixed
Get an attribute from the object .