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.
PMT function (fixed-rate, fixed-term periodic payment). That maps directly to: EMI/loan-payment calculators, lease and financing quote widgets, pricing-page "from $X/month" previews, and internal deal-desk tooling.composer.json. The formula is roughly three lines of arithmetic plus a zero-rate guard. The adoption cost (supply-chain review, wrapping, testing, owning a dead dependency) exceeds the build cost.IPMT/PPMT, RATE, NPER, IRR/XIRR, NPV — on the assumption this library grows into it. It won't.Adopt only if all of the following hold:
PMT and nothing else — no schedule generation, no principal/interest split, no rate solving.PaymentCalculator interface with your own tests and swap it out freely.Look elsewhere (or build in-house) when:
PMT. IPMT, PPMT, RATE, NPER, FV, IRR, XNPV are all out of scope. phpoffice/phpspreadsheet is the pragmatic choice if Excel parity across many functions is the actual requirement.PMT on floats drifts. For anything that touches invoices, ledgers, or stored amounts, compute in integer minor units — brick/money — and round with an explicit, tested policy.To executives: We evaluated a small open-source library for payment calculations. It does exactly one thing — Excel's PMT — has one star, zero downstream users, and hasn't been updated since 2018. Taking it as a dependency would add supply-chain and maintenance risk for a capability we can own in about twenty lines of tested code. Recommendation: do not adopt; build the calculation in-house behind an internal interface so we can extend to amortization schedules later without a migration. No cost, no vendor lock-in, no unmaintained code in our stack.
To engineering: Skip the dependency. Extract the PMT formula into a Finance\Payment value object, guard the zero-rate branch (the formula degenerates when r = 0), pin the sign convention, and round to minor units explicitly rather than trusting float output. Property-test against known Excel results across representative rate/term/principal combinations. If we later need IPMT/PPMT/RATE/IRR, we evaluate phpspreadsheet or extend our own module — not this package.
How can I help you explore Laravel packages today?