src/Mediable.php
private function mediaQualifiedRelatedKey()
    {
        $relation = $this->media();
        // Laravel 5.5
        if (method_exists($relation, 'getQualifiedRelatedPivotKeyName')) {
            return $relation->getQualifiedRelatedPivotKeyName();
        // Laravel 5.4
        } elseif (method_exists($relation, 'getQualifiedRelatedKeyName')) {
            return $relation->getQualifiedRelatedKeyName();
        }
        // Laravel <= 5.3
        return $relation->getOtherKey();
    }
private function mediaQualifiedRelatedKey()
    {
        $relation = $this->media();
        // Laravel 5.5
        if (method_exists($relation, 'getQualifiedRelatedPivotKeyName')) {
            return $relation->getQualifiedRelatedPivotKeyName();
        // Laravel 5.4
        } elseif (method_exists($relation, 'getQualifiedRelatedKeyName')) {
            return $relation->getQualifiedRelatedKeyName();
        }
        // Laravel <= 5.3
        return $relation->getOtherKey();
    }
private function mediaQualifiedRelatedKey ( ) { $ relation = $ this -> media ( ) ; // Laravel 5.5 if ( method_exists ( $ relation , 'getQualifiedRelatedPivotKeyName' ) ) { return $ relation -> getQualifiedRelatedPivotKeyName ( ) ; // Laravel 5.4 } elseif ( method_exists ( $ relation , 'getQualifiedRelatedKeyName' ) ) { return $ relation -> getQualifiedRelatedKeyName ( ) ; } // Laravel <= 5.3 return $ relation -> getOtherKey ( ) ; }
Key the name of the related key field of the media relation

Accounts for the change of method name in Laravel 5.4 and again in Laravel 5.5

@return string
Key the name of the related key field of the media relation