src/Services/SlugService.php
public function buildSlug(string $attribute, array $config, bool $force = null)
    {
        $slug = $this->model->getAttribute($attribute);

        if ($force || $this->needsSlugging($attribute, $config)) {
            $source = $this->getSlugSource($config['source']);

            if ($source || is_numeric($source)) {
                $slug = $this->generateSlug($source, $config, $attribute);
                $slug = $this->validateSlug($slug, $config, $attribute);
                $slug = $this->makeSlugUnique($slug, $config, $attribute);
            }
        }

        return $slug;
    }
public function buildSlug(string $attribute, array $config, bool $force = null)
    {
        $slug = $this->model->getAttribute($attribute);

        if ($force || $this->needsSlugging($attribute, $config)) {
            $source = $this->getSlugSource($config['source']);

            if ($source || is_numeric($source)) {
                $slug = $this->generateSlug($source, $config, $attribute);
                $slug = $this->validateSlug($slug, $config, $attribute);
                $slug = $this->makeSlugUnique($slug, $config, $attribute);
            }
        }

        return $slug;
    }
public function buildSlug ( string $ attribute , array $ config , bool $ force = null ) { $ slug = $ this -> model -> getAttribute ( $ attribute ) ; if ( $ force || $ this -> needsSlugging ( $ attribute , $ config ) ) { $ source = $ this -> getSlugSource ( $ config [ 'source' ] ) ; if ( $ source || is_numeric ( $ source ) ) { $ slug = $ this -> generateSlug ( $ source , $ config , $ attribute ) ; $ slug = $ this -> validateSlug ( $ slug , $ config , $ attribute ) ; $ slug = $ this -> makeSlugUnique ( $ slug , $ config , $ attribute ) ; } } return $ slug ; }
Build the slug for the given attribute of the current model.

@param string $attribute
@param array $config
@param bool $force

@return null|string
Build the slug for the given attribute of the current model .