use BookStack\Entities\Tools\SearchIndex;
use BookStack\Entities\Tools\SlugGenerator;
use BookStack\Facades\Permissions;
+use BookStack\Interfaces\Sluggable;
use BookStack\Model;
use BookStack\Traits\HasCreatorAndUpdater;
use BookStack\Traits\HasOwner;
* @method static Builder withLastView()
* @method static Builder withViewCount()
*/
-abstract class Entity extends Model
+abstract class Entity extends Model implements Sluggable
{
use SoftDeletes;
use HasCreatorAndUpdater;
}
/**
- * Generate and set a new URL slug for this model.
+ * @inheritdoc
*/
public function refreshSlug(): string
{
- $this->slug = (new SlugGenerator)->generate($this);
+ $this->slug = app(SlugGenerator::class)->generate($this);
return $this->slug;
}
}