protected function getValue($event) { if ($this->value instanceof Closure || is_array($this->value) && is_callable($this->value)) { return call_user_func($this->value, $event); } return $this->value; }
/** * @inheritdoc */ protected function getValue($event) { if ($this->attribute !== null) { if ($this->isNewSlugNeeded()) { $slugParts = []; foreach ((array) $this->attribute as $attribute) { $slugParts[] = $this->owner->{$attribute}; } $slug = $this->generateSlug($slugParts); } else { return $this->owner->{$this->slugAttribute}; } } else { $slug = parent::getValue($event); } return $this->ensureUnique ? $this->makeUnique($slug) : $slug; }