nova-flexible-content icon indicating copy to clipboard operation
nova-flexible-content copied to clipboard

Casts method inside HasFlexible trait

Open vladles opened this issue 1 year ago • 7 comments

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?

vladles avatar Sep 19 '22 10:09 vladles