public function getOwners()
    {
        return collect($this->belongsToRelations())
            ->reject(function ($relation) {
                // Rejects the relations whose foreign keys have been passed as custom attributes.
                return array_key_exists($relation->{$this->getBelongsToForeignKeyNameMethod()}(), $this->customAttributes)
                    || array_key_exists($relation->{$this->getBelongsToForeignKeyNameMethod()}(), $this->getFactoryAttributes($this->model))

                    // And the relations of the model to itself to prevent infinite recursion.
                    || $relation->getRelated() instanceof $this->model

                    // And dynamic relations in which the foreign key is selected with a subquery.
                    || !isset($this->columns[$relation->getRelated()->getForeignKey()]);
            })
            ->map(function ($relation) {
                return get_class($relation->getRelated());
            })
            ->all();
    }