Cviebrock\EloquentSluggable\Services\SlugService::getSlugEngine PHP Method

getSlugEngine() protected method

Return a class that has a slugify() method, used to convert strings into slugs.
protected getSlugEngine ( string $attribute ) : Slugify
$attribute string
return Cocur\Slugify\Slugify
    protected function getSlugEngine($attribute)
    {
        static $slugEngines = [];
        $key = get_class($this->model) . '.' . $attribute;
        if (!array_key_exists($key, $slugEngines)) {
            $engine = new Slugify();
            if (method_exists($this->model, 'customizeSlugEngine')) {
                $engine = $this->model->customizeSlugEngine($engine, $attribute);
            }
            $slugEngines[$key] = $engine;
        }
        return $slugEngines[$key];
    }