nova-flexible-content
nova-flexible-content copied to clipboard
Casts method inside HasFlexible trait
Inside the HasFlexible
trait (which we're using in FlexibleCast
) we're returning the raw value (string) when in the following context :
if(app()->getProvider(NovaServiceProvider::class) && !app()->runningInConsole() && !app()->environment('testing')) {
return $value;
}
In other words, if you're testing inside Nova itself it won't return the casted value (because the field will take care of it by itself). Is that your case ?
Originally posted by @toonvandenbos in https://github.com/whitecube/nova-flexible-content/issues/311#issuecomment-981578218
Could you explain this case - for what we need returns $value string if we want to use CASTS features?