public function getAttribute($key, $subKey = null)
    {
        if (! $key) {
            return;
        }

        // We'll normalize the given key to prevent case sensitivity issues.
        $key = $this->normalizeAttributeKey($key);

        if (is_null($subKey) && $this->hasAttribute($key)) {
            return $this->attributes[$key];
        } elseif ($this->hasAttribute($key, $subKey)) {
            return $this->attributes[$key][$subKey];
        }
    }
public function getAttribute($key, $subKey = null)
    {
        if (! $key) {
            return;
        }

        // We'll normalize the given key to prevent case sensitivity issues.
        $key = $this->normalizeAttributeKey($key);

        if (is_null($subKey) && $this->hasAttribute($key)) {
            return $this->attributes[$key];
        } elseif ($this->hasAttribute($key, $subKey)) {
            return $this->attributes[$key][$subKey];
        }
    }
public function getAttribute ( $ key , $ subKey = null ) { if ( ! $ key ) { return ; } // We'll normalize the given key to prevent case sensitivity issues. $ key = $ this -> normalizeAttributeKey ( $ key ) ; if ( is_null ( $ subKey ) && $ this -> hasAttribute ( $ key ) ) { return $ this -> attributes [ $ key ] ; } elseif ( $ this -> hasAttribute ( $ key , $ subKey ) ) { return $ this -> attributes [ $ key ] [ $ subKey ] ; } }
Returns the models attribute with the specified key.

If a sub-key is specified, it will try and
retrieve it from the parent keys array.

@param int|string $key
@param int|string $subKey

@return mixed
Returns the models attribute with the specified key .