jarouche/financial
A Laravel package for financial calculations, offering helpers for interest rates, amortization schedules, loan payments, and present/future value computations. Integrates cleanly with your PHP applications to handle common finance math without external dependencies.
Architecture fit. The package is a single-purpose utility class implementing Excel's PMT function (the standard loan-payment / annuity formula). As a TPM, I'd classify this as a leaf-node helper, not an architectural component. It has no service providers, facades, config, or container bindings implied by the description, so it does not participate in Laravel's ecosystem — you'd simply instantiate the class or call the static method. That makes it trivially embeddable but also means it delivers no framework integration value: no caching, no validation, no Money/BCMath abstraction. If our stack expects financial calculations to route through a shared domain service with rounding policy and currency handling, this package will sit outside that boundary.
Integration feasibility. Very high in the narrow sense: a Composer install and a call site. The real feasibility question is not "can we wire it in" but "should we own this formula." The PMT calculation is roughly ten lines of arithmetic; the cost of adding a dependency likely exceeds the cost of writing and testing it in-house. The package's stated direction ("more functions will be implemented in the future") is a red flag for a TPM, because it signals an intention to grow a library that has no growth evidence — one star, zero dependents, last release December 2018.
Technical risk. Several concrete risks:
PMT formula is sensitive to floating-point error and to the timing convention (payment at period end vs. beginning, via the type argument). The package description says nothing about rounding policy, decimal scale, or negative-sign convention for cash outflows. Undefined behavior here is a silent-wrong-number risk in any finance-facing feature.Key questions for the maintainer or internal owner:
PMT sign convention and the type (begin/end) parameter?Stack fit. Poor-to-neutral as a dependency; good as a reference implementation. It occupies no slot in a Laravel application's architecture — it is not a driver, not a provider, not a repository. The correct framing is that it is a formula snippet distributed via Packagist.
Migration path. My recommendation is a vendored extraction, not a Composer require. Copy the PMT implementation into an internal App\Support\Finance or, better, a small internal package (e.g. acme/finance-calc) with proper tests, strict types, declare(strict_types=1), and a documented rounding contract. This preserves the MIT-attributed math, removes the abandonment risk entirely, and gives us control over the API surface for the "more functions" we already know we need (FV, PV, NPV, IRR, IPMT, PPMT). Attribute the original per MIT and move on.
Compatibility. If, contrary to the above, a team insists on requiring it directly, pin the exact version (0.1.x or whatever the 2018 tag is), run the full test suite on PHP 8.2/8.3, and wrap every call in an adapter class so a future swap is a one-file change. Do not let raw package classes leak into domain code — the adapter should normalize inputs, enforce a rounding scale, and return a Money value object rather than a bare float.
Sequencing.
type handling, rounding scale — against Excel fixtures.Money-typed wrapper interface first, so downstream features code to our contract, not the package's.PMT directly — it is a small, well-documented formula.Maintenance. Effectively zero maintenance from upstream and therefore all maintenance transfers to us. A seven-year-dormant package is not a support relationship; it is a liability with a nice MIT license. We should budget for owning any code we adopt. The upside is that the code is small and the formula is stable mathematics — this is one of the rare cases where "abandoned" is survivable, provided we vendor it and test it ourselves.
Support. No vendor support, no active issue triage, no security response channel. For a pure arithmetic helper the security surface is negligible (no I/O, no deserialization, no network), which materially lowers this risk compared to a dormant package that parses input or touches storage. But there is no one to ask when a number looks wrong, and "looks wrong" in finance is the expensive kind of wrong.
Scaling. Computational scaling is a non-issue — the calculation is O(1) and would only appear in per-request loan/quote paths or batch amortization jobs, where it is negligible against database or I/O cost. The real scaling concern is blast radius: if a miscalculated payment figure reaches customer-facing quotes or invoicing, the cost scales with volume and with regulatory exposure, not with CPU. That argues for centralized, tested, versioned calculation logic rather than a scatter of package calls.
Failure modes.
type parameter produces a plausible-but-wrong payment. Highest-severity, lowest-detection failure mode.Ramp-up. Near-zero for any PHP developer — the API is a function call. The ramp-up burden is inverted: it lands on the reviewer and the QA engineer who must independently verify that the numbers match Excel and satisfy finance's rounding policy. That verification work is the true cost of adoption and should be scoped explicitly, not assumed.
How can I help you explore Laravel packages today?