How do I integrate `moneyphp/money` with text inputs and columns?

Hello! I want to use moneyphp/money such that: 1. On record creation, the user will input in major currency, dollars for example. 2. On save, moneyphp/money will convert the dollars into minor currency, cents in this case. 3. On edit, the user will be shown major currency. 4. On view in tables, the user will also be shown major currency. I should note that the field I'm storing the currency in is NOT a direct attribute on the table. It's in a JSON column using a repeater.
3 Replies
Povilas K
Povilas K4d ago
I would probably create a custom Eloquent attribute with get/set for that whole JSON column, transforming the money values back/forth
Raven
RavenOP4d ago
I found a Filament plugin that's a drop-in replacement for all money fields and it worked amazingly. Thank you!
Solution
Want results from more Discord servers?
Add your server