public function slugPattern()
    {
        if (!$this->slugPattern) {
            $metadata = $this->metadata();

            if (isset($metadata['routable']['pattern'])) {
                $this->setSlugPattern($metadata['routable']['pattern']);
            } elseif (isset($metadata['slug_pattern'])) {
                $this->setSlugPattern($metadata['slug_pattern']);
            } else {
                throw new Exception(sprintf(
                    'Undefined route pattern (slug) for %s',
                    get_called_class()
                ));
            }
        }

        return $this->slugPattern;
    }