src/Slug.php
public function getSlug($forceRegeneration = false)
    {
        $owner = $this->getOwner();
        $field = $this->fieldToSlug;
        $unfilteredSlug = $owner->URLSlug;
        if (!$unfilteredSlug || $forceRegeneration) {
            $unfilteredSlug = $owner->$field;
        }
        return URLSegmentFilter::create()->filter($unfilteredSlug);
    }
public function getSlug($forceRegeneration = false)
    {
        $owner = $this->getOwner();
        $field = $this->fieldToSlug;
        $unfilteredSlug = $owner->URLSlug;
        if (!$unfilteredSlug || $forceRegeneration) {
            $unfilteredSlug = $owner->$field;
        }
        return URLSegmentFilter::create()->filter($unfilteredSlug);
    }
Generate a url slug segment

@param  boolean $forceRegeneration
@return string