Download the PHP package zzzzzqs/repayment without Composer
On this page you can find all versions of the php package zzzzzqs/repayment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download zzzzzqs/repayment
More information about zzzzzqs/repayment
Files in zzzzzqs/repayment
Download zzzzzqs/repayment
More information about zzzzzqs/repayment
Files in zzzzzqs/repayment
Vendor zzzzzqs
Package repayment
Short Description laravel package for calculating equal principal interest and equal principal repayment
License MIT
Package repayment
Short Description laravel package for calculating equal principal interest and equal principal repayment
License MIT
Please rate this library. Is it a good library?
Informations about the package repayment
Repayment
A laravel package for calculating equal principal interest and equal principal repayment.
Installation
If you're using Composer to manage dependencies, you can use:
composer require zzzzzqs/repayment
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
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
// 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"
],
……
]All versions of repayment with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
ext-bcmath Version *
ext-bcmath Version *
The package zzzzzqs/repayment contains the following files
Loading the files please wait ...