A simple mortgage calculator for Laravel. Laravel-mortgage allows you to calculate the mortgage in two ways:
An annuity is a series of payments made at equal intervals. Examples of annuities are regular deposits to a savings account, monthly home mortgage payments, monthly insurance payments and pension payments. Annuities can be classified by the frequency of payment dates.
Differentiated payment - this is an unequal monthly tranche proportionally reduced during the loan term. The largest payments - in the fourth quarter. “Median” payments are usually comparable to annuities.
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require mhiggster/laravel-mortgage
Add a new line to the providers
array:
Mortgage\MortgageServiceProvider::class,
And optionally add a new line to the aliases
array:
'DifferentiatedPayment' => Mortgage\Facades\DifferentiatedPayment::class,
'Annuity' => Mortgage\Facades\Annuity::class,
And then publish the config file
php artisan vendor:publish --provider="Mortgage\MortgageServiceProvider"
Now you're ready to start using the laravel-mortgage in your application.
Look at one of the following topics to learn more about LaravelMortgage
the Mortgage gives you two facades:
Annuity
and Differentiated
These facades gives you the following methods to use:
Simple getter which retrieves the loan term. Period for which the debtor must repay the loan
Annuity::getLoanTerm() // 48
Simple getter which retrieves the loan amount. The method allows you to find out how much the debtor took a loan
Annuity::getLoanAmount() // 8000000
Simple getter which retrieves the interest rate. at what interest rate did the lender give a loan
Annuity::getInterestRate() // 18
Simple getter which retrieves the main dept. You can round them as you want
Annuity::getMainDept() // 166666.66666667
This method returns a collection, which helps to find out termInMonth
, totoalDept
, percentDept
, mainDept
, indebtedness
using this data you can build a repayment schedule. an example you can see below
Annuity::showRepaymentSchedule()
Amount accrued as a percentage
Annuity::getPercentAmount()
The effective annual interest rate is the interest rate that is actually earned or paid on an investment.
Annuity::effectiveRate()
The total amount payable to the debtor
Annuity::getTotalamount()
If you want to use your own data
Annuity::setViscera(48, 8000000, 18)
Similarly, all of these methods are available on the Differentiated facade.
Below is a little example of how to list the cart content in a table:
// 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>
Detailed changes for each release changelog
Copyright (c) 2019-present, Miras Nurmukhanbetov