Replies: 2 comments 1 reply
-
Yeah, I'd like to support this. |
Beta Was this translation helpful? Give feedback.
-
I did a new pull-request in the right place: #17608 @Estigy - I tried to have a go with your stacked formatStateUsing but had issues testing TextEntry components. I also wasn't sure on your exact use case. I came across something like what you are suggesting in the past when I tried to add VAT to a price, and then wanted to format it to money, but in the end, I appended an attribute on the model itself and passed that through to the money() transformer. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am proposing this change to improve some functionality in line with the Code quality tips in the filament documentation: https://filamentphp.com/docs/4.x/resources/code-quality-tips
Recently, I've taken to directly extending some Schema classes instead of following the suggestions in "Code quality tips" page.
Suggested:
Example one of my approach:
Utilised like:
Example two of my approach:
Utilised like:
But in example two, if I have one Text Input where I need to removeWhitespace and Capitalise the text then I don't have the ability to do this currently.
For example with a postcode, if it is entered like " wo98 0AJ" and I want it to be "WO98 0AJ", ideally I could do something like this:
and then call
So the idea here is to "stack" the dehydration callbacks, like a pipeline, to then be executed. This allows for a flexible class that keeps the concerns in one place.
I have submitted a pull-request on the repo where the code would need to be changed: filamentphp/schemas#1. Please let me know if this would be a valuable contribution and how I might be able to test it to reinforce the framework.
Beta Was this translation helpful? Give feedback.
All reactions