Download the PHP package dgtlinf/salary-calculator without Composer
On this page you can find all versions of the php package dgtlinf/salary-calculator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package salary-calculator
Salary Calculator for Laravel
A modern, extensible Laravel package for standardized salary calculations across multiple countries.
Supports detailed breakdowns for gross, net, contributions, and total employer costs โ starting with Serbia (RS).
๐ฆ Installation
Install the package via Composer:
โ๏ธ Usage Example
๐ Example JSON Response
โ๏ธ Configuration
The package publishes a config file config/salary-calculator.php allowing full control over:
- Country providers and validators
- Default rounding precision
- Validation behavior and output structure
- Optional external tax table directory
๐งฉ Validation Behavior
SalaryCalculator::validateOutput($result) uses the config-defined validators to ensure data structure integrity.
Behavior can be customized in config/salary-calculator.php:
| Option | Description |
|---|---|
strict_validation |
Throw exception if validator missing |
fallback_to_base_validator |
Use BaseOutputValidator if no country-specific validator |
include_context_in_output |
Whether to include the context block in output |
๐งช Testing
๐งฑ Architecture Overview
- SalaryCalculatorManager โ Resolves and loads the correct provider based on country and year.
- Country Providers โ Contain tax rules and salary logic for each country (e.g.,
RSCountryProvider). - Output Validators โ Verify structure of salary data before use (Payslip integration-ready).
- Tax Tables โ Organized per country and year under
/SalaryProviders/{Country}/TaxTables/{Year}.php. - Traits โ Shared helpers such as
RoundingTraitfor precision and numeric consistency.
๐งพ Changelog
All notable changes are automatically documented in CHANGELOG.md.
Changelog updates automatically on each GitHub release.
๐ชช License
The MIT License (MIT).
See LICENSE.md for more information.
๐ค Author
Digital Infinity DOO
Bulevar Kralja Petra I 89, Novi Sad, Serbia
www.digitalinfinity.rs
All versions of salary-calculator with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.92
cmixin/business-day Version ^1.20