nova-flexible-content
nova-flexible-content copied to clipboard
Force cast for manipulate Flexible in Nova
Hello,
It's possible to add $force params in flexible trait ?
public function flexible($attribute, $layoutMapping = [], $force = false)
{
$flexible = data_get($this->attributes, $attribute);
return $this->cast($flexible, $layoutMapping, $force);
}
public function cast($value, $layoutMapping = [], $force = false)
{
if (!$force && app()->getProvider(NovaServiceProvider::class) && ! app()->runningInConsole()) {
return $value;
}
return $this->toFlexible($value ?: null, $layoutMapping);
}