Show Correct Currency Values in Edit Views with Laravel Money
Hello ,
I’m integrating
laravel-money
laravel-money
with the following workflow: - During record creation, users can enter an amount in their preferred currency (for example, BDT or USD). - When saving,
laravel-money
laravel-money
should automatically convert the amount into its minor unit (such as cents). - When editing, the form should display the value in the original currency chosen by the user. - When viewing records in tables, the displayed amount should match what’s shown in the edit form.
I’ve already configured the create and show functionality using Eloquent Model attribute casting:
'price' => MoneyIntegerCast::class . ':currency',
'price' => MoneyIntegerCast::class . ':currency',
The database table has two columns:
price
price
and
currency
currency
.
My question: How can I display the correct currency value in the edit form using laravel-money?