jn-devops / borrower
Homeful Borrower Package
Fund package maintenance!
Homeful
Installs: 2 460
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- jn-devops/property: ^v1.0
- spatie/laravel-data: ^4.6
- spatie/laravel-package-tools: ^1.16
- whitecube/php-prices: ^v3.0.0
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
Description
The Homeful Borrower Package is a modular PHP package designed for handling borrower-related functionalities. It integrates financial calculations, lending institution rules, and employment types to assess a borrower's loan eligibility.
This package provides:
- Borrower age and validation rules
- Employment classification and income tracking
- Loan eligibility computations based on disposable income
- Co-borrower support with joint income evaluation
- Lending institution configurations with maximum loan terms
- Payment mode management
Features
📌 Age Management
- Retrieve and format borrower age
- Set borrower age and birthdate
- Validate minimum and maximum borrowing ages
💰 Employment & Income
- Assign employment type (Private, Government, OFW, Business)
- Compute gross monthly income and disposable income
- Support for multiple sources of income
🏦 Lending Institutions & Loan Terms
- Define lending institutions with borrowing rules
- Determine maximum loan term based on institution settings
- Handle institution-specific age restrictions
🤝 Co-Borrowers & Joint Income
- Add co-borrowers and calculate total joint disposable income
- Identify the youngest and oldest co-borrower
💳 Payment & Contact Information
- Set payment modes (Online, Salary Deduction, Over-the-Counter)
- Assign and retrieve borrower contact details
- Validate and format borrower mobile numbers
Installation
To install via Composer, run:
composer require jn-devops/borrower
Usage
🔹 Creating a Borrower Instance
use Homeful\Borrower\Borrower; use Illuminate\Support\Carbon; use Brick\Money\Money; $borrower = new Borrower(); $borrower->setBirthdate(Carbon::parse('1999-03-17')); $borrower->setGrossMonthlyIncome(Money::of(15000.0, 'PHP'));
🔹 Setting Employment Type
use Homeful\Borrower\Enums\EmploymentType; $borrower->setEmploymentType(EmploymentType::LOCAL_PRIVATE);
🔹 Adding Co-Borrowers
$coBorrower = (new Borrower())->setBirthdate(Carbon::parse('2001-03-17'))->setGrossMonthlyIncome(Money::of(14000.0, 'PHP')); $borrower->addCoBorrower($coBorrower);
🔹 Calculating Disposable Income
$monthlyDisposableIncome = $borrower->getMonthlyDisposableIncome();
🔹 Lending Institution & Loan Term
use Homeful\Borrower\Classes\LendingInstitution; $lendingInstitution = new LendingInstitution('hdmf'); $borrower->setLendingInstitution($lendingInstitution); $maxTerm = $borrower->getMaximumTermAllowed();
Testing
Run the tests with:
composer test
Author
- Lester B. Hurtado
Email: devops@joy-nostalg.com
GitHub: jn-devops
License
This package is open-source software licensed under the MIT License. See the License File for details.