I am using Laravel Nova to administrate my project. However, I save certain values in my database like percentages or prices as x*100. Why I am doing this? Because when saving numbers *100 I can store them as int instead of double or float.
However, this leads to the problem that I am seeing the number which is saved and multiplied by 100 in the database on my Laravel Nova Admin dashboard. I mean I can bypass that by using resolveUsing or displayUsing (read here). Then e.g. 1530 will be presented as 15,30 when diving by 100 which is correct.
The only problem with this is when typing 100 in the percentage field e.g. it also gets saved as 100 and not as 10000 (100*100). Does anybody knows how I can implement this?
I also tried to use eloquent observers. But this doesn't work because I end up in a infinity loop.
Kind regards and thank you!