PHPackages                             zzzzzqs/repayment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zzzzzqs/repayment

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zzzzzqs/repayment
=================

laravel package for calculating equal principal interest and equal principal repayment

1.0.5(1y ago)03MITPHPPHP ^8.0

Since Nov 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zzzzzqs/repayment)[ Packagist](https://packagist.org/packages/zzzzzqs/repayment)[ RSS](/packages/zzzzzqs-repayment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

Repayment
=========

[](#repayment)

[![Run Tests](https://github.com/zzzzzqs/repayment/actions/workflows/main.yml/badge.svg)](https://github.com/zzzzzqs/repayment/actions/workflows/main.yml)

A laravel package for calculating equal principal interest and equal principal repayment.

### Installation

[](#installation)

If you're using Composer to manage dependencies, you can use:

```
composer require zzzzzqs/repayment

```

### Add service provider

[](#add-service-provider)

Add the service provider to the providers array in the config/app.php config file as follows:

```
'providers' => [

    ...

    \Zzzzzqs\Repayment\RepaymentServiceProvider::class,
]

```

### Publish the config

[](#publish-the-config)

Run the following command to publish the package config file:

```
php artisan vendor:publish --provider="Zzzzzqs\Repayment\RepaymentServiceProvider"

```

You should now have a config/repayment.php file that allows you to configure the basics of this package.

### Usage

[](#usage)

```
// epc means: matching the principal repayment
// etc means: average capital plus interest

public function __construct(PaymentCalculatorFactory $calculatorFactory)
{
    $this->calculatorFactory = $calculatorFactory;
}

public function calculate($type, $principal, $interestRate, $years)
{
    $calculator = $this->calculatorFactory->create($type, $principal, $interestRate, $years);
    return $calculator->getResult();
}

// param like this:
// $principal = 120000;
// $yearInterestRate = "0.0486";
// $year = 10;

// the result is a object like RepaymentDTO;
// if you want a array, you can $calculator->getSchedule return the new result like:
[
    1 => [
        "period" => 1
        "principal" => "1000.00"
        "interest" => "486.00"
        "total_money" => "1486.00"
    ],
    2 => [
        "period" => 2
        "principal" => "1000.00"
        "interest" => "481.95"
        "total_money" => "1481.95"
    ],

    ……
]

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance41

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

522d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c289edd2fbc60a9bf1f399931b812abc26dcd458be2c14e92c23963ee172102?d=identicon)[zzzzzqs](/maintainers/zzzzzqs)

---

Top Contributors

[![zzzzzqs](https://avatars.githubusercontent.com/u/187351440?v=4)](https://github.com/zzzzzqs "zzzzzqs (5 commits)")

### Embed Badge

![Health badge](/badges/zzzzzqs-repayment/health.svg)

```
[![Health](https://phpackages.com/badges/zzzzzqs-repayment/health.svg)](https://phpackages.com/packages/zzzzzqs-repayment)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
