private function mediaQualifiedForeignKey()
    {
        $relation = $this->media();
        if (method_exists($relation, 'getQualifiedForeignPivotKeyName')) {
            return $relation->getQualifiedForeignPivotKeyName();
        } elseif (method_exists($relation, 'getQualifiedForeignKeyName')) {
            return $relation->getQualifiedForeignKeyName();
        }
        return $relation->getForeignKey();
    }