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();
    }