protected function getRelationMappedMorphType($class)
    {
        $map = Relation::morphMap();

        if (empty($map)) {
            return ltrim($class, '\\');
        }

        if (    false !== ($type = array_search($class, $map))
            ||  false !== ($type = array_search(ltrim($class, '\\'), $map))
        ) {
            return $type;
        }

        return trim($class, '\\');
    }
protected function getRelationMappedMorphType($class)
    {
        $map = Relation::morphMap();

        if (empty($map)) {
            return ltrim($class, '\\');
        }

        if (    false !== ($type = array_search($class, $map))
            ||  false !== ($type = array_search(ltrim($class, '\\'), $map))
        ) {
            return $type;
        }

        return trim($class, '\\');
    }
protected function getRelationMappedMorphType ( $ class ) { $ map = Relation :: morphMap ( ) ; if ( empty ( $ map ) ) { return ltrim ( $ class , '\\' ) ; } if ( false !== ( $ type = array_search ( $ class , $ map ) ) || false !== ( $ type = array_search ( ltrim ( $ class , '\\' ) , $ map ) ) ) { return $ type ; } return trim ( $ class , '\\' ) ; }
Returns morph relation type string for a model class, or returns class if not mapped.

@param string $class
@return string
Returns morph relation type string for a model class or returns class if not mapped .