-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Casts method inside HasFlexible trait #389
Comments
Maybe you meant the opposite? if(!app()->getProvider(NovaServiceProvider::class) && app()->runningInConsole() && app()->environment('testing')) { |
When I apply this code in MyFlexibleCast class and implements it for custom class, I faced with issue with laravel-nova pages, we faced the problem "Undefined property: stdClass::$layout". // $value = data_get($resource, str_replace('->', '.', $attribute)) ?? [];
$value = $resource->getRawOriginal(str_replace('->', '.', $attribute)) ?? []; And we can just call the getRawOriginal method (laravel 7+). And everything will be works! |
Man... trying all this stuff now - I'm so confused so just changed this in whitecube and hoepfully it'll stop returning a string.. |
Lol nope - https://share.getcloudapp.com/d5unwGr9 - I know this is... something as I'm close and it works in routes.. just not in... like anywhere else - just returning a string. |
Ahhh! That's all I want - https://share.getcloudapp.com/wbuQ9RyW - I'm going crazy here lol - got phpStorm open trying to do this |
Sorry for the delay, did you solve your problem? |
Hey!! Nah it's all good and great timing - I actually just figured out today how to like... create a templating system using your flexible field thingie (populate rows on drop down of my other Vue element)... so yeh - it works awesomely! Please don't leave again! Haha... I guess I need to like show my support and sponsor you guys otherwise I can't really complain if you guys go AWOL for months lol |
Inside the
HasFlexible
trait (which we're using inFlexibleCast
) we're returning the raw value (string) when in the following context :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 #311 (comment)
Could you explain this case - for what we need returns $value string if we want to use CASTS features?
The text was updated successfully, but these errors were encountered: