Support the ongoing development of Laravel.io →
Input Eloquent Architecture

Hello,

so i am creating value Money( 500, Currency('EUR') ). What would be the best approach to validate Currency if allowed currencies are dynamically created and stored in db? Should i run query each time Currency object is created? Of course it can be cached and so, but how should i access persistence layer from with in Currency object (i cant pass it in constructor)?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

revati revati Joined 31 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.