public function belongsToComponent($class, $component, $classOnly = true)
    {
        $belongsTo = (array)Config::forClass($class)->get('belongs_to');
        if (!isset($belongsTo[$component])) {
            return null;
        }

        // Remove has_one specifier if given
        $belongsTo = $belongsTo[$component];
        $belongsToClass = strtok($belongsTo, '.');

        // Validate
        $this->checkRelationClass($class, $component, $belongsToClass, 'belongs_to');
        return $classOnly ? $belongsToClass : $belongsTo;
    }