mhiggster/laravel-mortgage

抵押贷款

v0.1.1 2019-10-02 02:07 UTC

This package is auto-updated.

Last update: 2024-09-12 19:03:27 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

这是一个简单的Laravel抵押贷款计算器。Laravel-mortgage允许您以两种方式计算抵押贷款

年金

年金是一系列在相等间隔内做出的支付。年金的例子包括定期存入储蓄账户、每月的房屋抵押贷款还款、每月的保险支付和养老金支付。年金可以根据支付日期的频率进行分类。

差异支付

差异支付 - 这是贷款期间比例递减的不等额月度分期付款。最大的支付 - 在第四季度。“中值”支付通常与年金相当。

安装

通过Composer安装此包。

在终端中运行Composer require命令

composer require mhiggster/laravel-mortgage

providers数组添加新行

Mortgage\MortgageServiceProvider::class,

可选地,向aliases数组添加新行

'DifferentiatedPayment' => Mortgage\Facades\DifferentiatedPayment::class,
'Annuity' => Mortgage\Facades\Annuity::class,

然后发布配置文件

php artisan vendor:publish --provider="Mortgage\MortgageServiceProvider"

现在您可以在应用程序中使用laravel-mortgage了。

概述

查看以下主题以了解更多关于LaravelMortgage的信息

使用

抵押贷款提供了两个外观:AnnuityDifferentiated 这些外观为您提供以下方法来使用

Annuity::getLoanTerm()

简单获取器,检索贷款期限。债务人必须偿还贷款的期限

Annuity::getLoanTerm() // 48

Annuity::getLoanAmount()

简单获取器,检索贷款金额。此方法允许您了解债务人借了多少钱

Annuity::getLoanAmount() // 8000000

Annuity::getInterestRate()

简单获取器,检索利率。贷款人给出贷款的利率

Annuity::getInterestRate() // 18

Annuity::getMainDept()

简单获取器,检索主要债务。您可以根据需要将它们四舍五入

Annuity::getMainDept() // 166666.66666667

Annuity::showRepaymentSchedule()

此方法返回一个集合,有助于使用此数据找到termInMonthtotoalDeptpercentDeptmainDeptindebtedness,您可以使用这些数据构建还款计划。以下是一个示例

Annuity::showRepaymentSchedule()

Annuity::getPercentAmount()

按百分比累计的金额

Annuity::getPercentAmount()

Annuity::effectiveRate()

实际年利率是投资实际赚取或支付的利率。

Annuity::effectiveRate()

Annuity::getTotalamount()

应支付给债务人的总金额

Annuity::getTotalamount()

Annuity::setViscera(48, 8000000, 18)

如果您想使用自己的数据

Annuity::setViscera(48, 8000000, 18)

同样,所有这些方法都在不同的外观上可用。

示例

以下是如何在表格中列出购物车内容的示例

 // Display the content in a View.
<table>
    <thead>
        <tr>
            <th>Term in month</th>
            <th>Totoal dept</th>
            <th>Percent dept</th>
            <th>Main dept</th>
            <th>Indebtedness</th>
        </tr>
    </thead>

    <tbody>

        @foreach(Annuity::showRepaymentSchedule() as $row)

            <tr>
                <td>{{ termInMonth }}</td>
                <td>{{ totoalDept }}</td>
                <td>{{ percentDept }}</td>
                <td>{{ mainDept }}</td>
                <td>{{ indebtedness }}</td>
            </tr>

        @endforeach

    </tbody>
</table>

变更日志

每个版本详细更改 changelog

许可

MIT

版权(c)2019-至今,Miras Nurmukhanbetov