Cviebrock\EloquentSluggable\Services\SlugService::needsSlugging PHP Méthode

needsSlugging() protected méthode

Determines whether the model needs slugging.
protected needsSlugging ( string $attribute, array $config ) : boolean
$attribute string
$config array
Résultat boolean
    protected function needsSlugging($attribute, array $config)
    {
        if (empty($this->model->getAttributeValue($attribute)) || $config['onUpdate'] === true) {
            return true;
        }
        if ($this->model->isDirty($attribute)) {
            return false;
        }
        return !$this->model->exists;
    }