money-bundle provides a clean, domain-driven approach to handling currency-aware monetary values (e.g., pricing, payments, financial calculations) using the Fowler Money Pattern. This aligns well with Symfony-based applications requiring strict financial precision, multi-currency support, or compliance with accounting standards (e.g., GAAP, IFRS).Money objects (e.g., amount, currency fields). Use Doctrine’s Type System or custom mappings.Money objects (e.g., conversion to/from gateway-specific formats).Money type.Money) may complicate future migrations.Money objects via custom types or embeddable mappings.price DECIMAL(10,2)) and business rules.Order) to use Money types.Money objects in services, repositories, and forms.currency column, use MoneyType).MoneyType or create a custom Embeddable for complex scenarios.MoneyType for user input (e.g., <input type="money">).Money objects to JSON (e.g., {"amount": 100, "currency": "USD"}) or use API Platform’s metadata.float → Money) during migration.composer require coverd/money-bundle.config/bundles.php and set up Doctrine types.Money fields in entities (e.g., #[ORM\Column(type: MoneyType::NAME)]).Money objects.MoneyType.ext-intl) may require updates.Money objects in requests/responses.currency fields if querying by currency is common.Money objects in OPcache or Redis for high-throughput APIs.Money operations scale well, but currency conversion services may become bottlenecks.Money objects via GraphQL or gRPC for cross-service consistency.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Currency conversion service down | Failed transactions, incorrect pricing | Fallback to cached rates or manual overrides. |
| Database corruption (Money fields) | Data inconsistency | Use transactions and backups. |
| Floating-point precision errors | Incorrect financial calculations | Test edge cases; use Money::zero() for defaults. |
| Bundle version incompatibility | Breaking changes | Pin versions in composer.json; test upgrades. |
| Third-party API misalignment | Payment gateway failures | Validate Money ↔ gateway format mappings. |
Money usage.Money types in PRs.Money::USD(100)->add(Money::EUR(50))).Money was chosen over alternatives (e.g., raw floats).How can I help you explore Laravel packages today?