roundly-consulting/money-for-laravel
Money for Laravel brings precise monetary handling to Laravel apps with an immutable Money value object, Eloquent casts, and Blade formatting helpers. Parse, calculate, and format currency amounts without floating-point errors, keeping prices, totals, and invoices clean and testable.
Architecture fit: The package appears to provide configurable model resolution plus Laravel model factories. Release 1.0.3 fixes factory behavior so that when a host application swaps a model via configuration or container binding, the factory builds the configured class rather than a hard-coded default. This aligns well with Laravel’s config-driven and service-container-centric architecture, and it supports common host-application patterns such as extending core models, modular replacement, or multi-tenant model variants. For a TPM, the fix improves test and seeder fidelity: host applications can swap models and still rely on package-provided factories.
Integration feasibility: Low integration effort. The change is a patch-level bug fix with no new APIs, migrations, or configuration requirements indicated. Hosts already swapping models should see factories align automatically after a Composer update to ^1.0.3. Hosts not swapping models should see no behavioral change. The main integration work is validating that existing factory states, overrides, and relationships still work with swapped model classes.
Technical risk: Low overall, but not zero. The fix changes which class a factory instantiates when a swap is configured. Risk arises if a swapped model has a different table, fillable set, casts, or relationship contract than the default model; factories may now fail earlier or produce different data. There is also a small risk for hosts that unintentionally depended on the old behavior (factories returning the default model despite a swap), though that behavior is arguably a bug. No breaking changes are signaled by the patch version, but the package’s pre-1.1 status means API stability should still be watched.
Key questions:
make, create, times, states, sequences, relationship factories)?Stack fit: Standard Laravel/PHP package managed via Composer. It fits applications using PHPUnit or Pest, Eloquent factories, and seeders. It is particularly relevant for teams using model-swap or modular architecture patterns, where host applications replace package models with local subclasses or variants.
Migration path: Update the Composer constraint to ^1.0.3 and refresh the lock file. No database migrations or configuration changes are indicated. After updating, run the full test suite, including tests that exercise factories and seeders. Audit any custom factories or test helpers that manually swapped models before this fix; those workarounds may now be redundant or could conflict.
Compatibility: The release is a patch, so it should be semver-compatible with existing 1.0.x integrations. Confirm the package’s supported Laravel versions and PHP version before updating. Because the fix concerns Eloquent factory behavior, verify there is no conflict with the framework’s own factory guessing or with host-defined factories that extend package factories.
Sequencing:
Maintenance: Low. This patch reduces the need for custom test scaffolding around swapped models. Maintainers should track subsequent 1.0.x releases and confirm the package’s release cadence and changelog quality. Internal documentation should note the supported model-swap mechanism and any model contract requirements.
Support: The package appears open-source; formal vendor support is unknown. A TPM should assign internal ownership for upgrades and ensure the team can debug factory/model mismatches. If the package is business-critical, consider pinning versions and monitoring upstream issues related to model swapping and factories.
Scaling: Factories are used in development, testing, and seeding, so there is no expected runtime scaling impact. Seeder performance should be unchanged. The fix may improve test suite reliability at scale by removing per-test workarounds and reducing false failures caused by factories ignoring swapped models.
Failure modes: The most likely failure mode is a swapped model whose schema or Eloquent contract differs from the default model, causing factory-created records to be invalid or relationships to break. The fix surfaces these mismatches earlier, which is desirable but may require host teams to align their swapped models. Another failure mode is reliance on the previous behavior in existing tests; these should be identified during the test run. Production seeder behavior should be verified if seeders swap models.
Ramp-up: Minimal. Engineers need a short briefing on how model swapping is configured, which models are swappable, and how the package factories resolve the configured model. Add a note to the internal testing guide covering the regression test pattern and the expected model contract. New team members can ramp up through existing Laravel factory knowledge plus the package’s swap configuration documentation.
How can I help you explore Laravel packages today?