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];
}