src/Services/SlugService.php
public function slug(Model $model, bool $force = false): bool
    {
        $this->setModel($model);

        $attributes = [];

        foreach ($this->model->sluggable() as $attribute => $config) {
            if (is_numeric($attribute)) {
                $attribute = $config;
                $config = $this->getConfiguration();
            } else {
                $config = $this->getConfiguration($config);
            }

            $slug = $this->buildSlug($attribute, $config, $force);

            if ($slug !== null) {
                $this->model->setAttribute($attribute, $slug);
                $attributes[] = $attribute;
            }
        }

        return $this->model->isDirty($attributes);
    }
public function slug(Model $model, bool $force = false): bool
    {
        $this->setModel($model);

        $attributes = [];

        foreach ($this->model->sluggable() as $attribute => $config) {
            if (is_numeric($attribute)) {
                $attribute = $config;
                $config = $this->getConfiguration();
            } else {
                $config = $this->getConfiguration($config);
            }

            $slug = $this->buildSlug($attribute, $config, $force);

            if ($slug !== null) {
                $this->model->setAttribute($attribute, $slug);
                $attributes[] = $attribute;
            }
        }

        return $this->model->isDirty($attributes);
    }
public function slug ( Model $ model , bool $ force = false ) : bool { $ this -> setModel ( $ model ) ; $ attributes = [ ] ; foreach ( $ this -> model -> sluggable ( ) as $ attribute => $ config ) { if ( is_numeric ( $ attribute ) ) { $ attribute = $ config ; $ config = $ this -> getConfiguration ( ) ; } else { $ config = $ this -> getConfiguration ( $ config ) ; } $ slug = $ this -> buildSlug ( $ attribute , $ config , $ force ) ; if ( $ slug !== null ) { $ this -> model -> setAttribute ( $ attribute , $ slug ) ; $ attributes [ ] = $ attribute ; } } return $ this -> model -> isDirty ( $ attributes ) ; }
Slug the current model.

@param \Illuminate\Database\Eloquent\Model $model
@param bool $force

@return bool
Slug the current model .