PHPackages                             laudis/fiscal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laudis/fiscal

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laudis/fiscal
=============

library for common fiscal operations

1.4.0(4y ago)0201MITPHP

Since Dec 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/laudis-technologies/fiscal)[ Packagist](https://packagist.org/packages/laudis/fiscal)[ RSS](/packages/laudis-fiscal/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (14)Used By (0)

Laudis Fiscal Library
=====================

[](#laudis-fiscal-library)

[![Latest Stable Version](https://camo.githubusercontent.com/f346b528c61e6644a62c9ff3381aac09d644c6b256c386417076289049a8ff91/68747470733a2f2f706f7365722e707567782e6f72672f6c61756469732f66697363616c2f76)](//packagist.org/packages/laudis/fiscal)[![Total Downloads](https://camo.githubusercontent.com/b050d9d17bb4c90ccf37aac93a6bea6669b2ad515e99a283ee0b2b6690498b37/68747470733a2f2f706f7365722e707567782e6f72672f6c61756469732f66697363616c2f646f776e6c6f616473)](//packagist.org/packages/laudis/fiscal)[![Monthly Downloads](https://camo.githubusercontent.com/848d76084b86962b814453c6e9a3bdb87e50cdaa6951ab2b43b836e656d47389/68747470733a2f2f706f7365722e707567782e6f72672f6c61756469732f66697363616c2f642f6d6f6e74686c79)](//packagist.org/packages/laudis/fiscal)[![Maintainability](https://camo.githubusercontent.com/95e3c6584e87aeff36000b182c8aefd75f2365f6aa880bd56a346bf440a41577/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31643137326362316233646364383266346237342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/laudis-technologies/fiscal/maintainability)[![Test Coverage](https://camo.githubusercontent.com/f5287e397af158a23e262a81b5af44a1bc026a96335616b80a4b7cd22376961a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31643137326362316233646364383266346237342f746573745f636f766572616765)](https://codeclimate.com/github/laudis-technologies/fiscal/test_coverage)[![MIT License](https://camo.githubusercontent.com/7c124530b7c185c6928998842a1a52ed4bfd21071bf67db8f325f470cc3160a3/68747470733a2f2f696d672e736869656c64732e696f2f61706d2f6c2f61746f6d69632d64657369676e2d75692e7376673f)](https://github.com/laudis-technologies/fiscal/blob/main/LICENSE)

Installation
------------

[](#installation)

Install via composer:

```
composer require laudis/fiscal
```

General usage
-------------

[](#general-usage)

Laudis fiscal library is essentially a client which pulls fiscal information from a database and provides classes to translate it into business logic.

### Initializing the repository

[](#initializing-the-repository)

Everything starts from the repository:

```
$repository = new \Laudis\Fiscal\FiscalRepository(new PDO(getenv('PDO_DSN'), getenv('USERNAME'), getenv('PASSWORD')));
```

### Loading indexed values

[](#loading-indexed-values)

Indexed values a values that change over a period in time. Laudis fiscal interprets indexed values as essentially ranges of dates with a value and some identifying information.

```
// The date argument can either be a string in the Y-m-d format, an integer representing a timestamp, or an object implementing \DateTimeInterface.
$values = $repository->loadIndexedValuesWithSlugs('2010-01-01', ['cpi', 'euribor', 'protected-property-car-amount-AUS']);

$euribor = $values->get('euribor'); // Returns the euribor of that day
$cpi = $values->get('cpi'); // Throws OutOfBoundsException if it wasn't found for that day
$protected = $values->get('protected-property-car-amount-AUS', null); // Will return null instead of throwing when it wasn't found on that day.
```

### Loading scales

[](#loading-scales)

Scales are a combination of ranges composed by rules which in turn will apply a factor on the value of each of these rules.

Example:

Scale personal tax Belgium taxation year 2020 (yes this is real):

fromuntilfixedpercentage0.0013 250.000.0025.00%13 250.0023 390.003 312.5040.00%23 390.0040 480.007 368.5045.00%40 480.00...15 059.0050.00%Laudis fiscal understands this logic which they can be loaded like this:

```
$scale = $repository->loadScaleWithSlugs(DateTime::createFromFormat('Y-m-d', '2020-01-01'), ['personal-tax'])->first();

echo $scale->calculate(50000); // echos 13 250.00
echo $scale->calculate(8000); // echos 2000
```

Scales can further be exploited to fully explain the logic they are doing:

```
$explanation = $scale->explain(50000);
```

### Fiscal Feature Support

[](#fiscal-feature-support)

**Feature****Supported?**Indexed ValuesReadScalesReadMysql supportYesRequirements
------------

[](#requirements)

- PHP &gt;= 7.4
- A mariadb/mysql database
- ext-json
- ext-pdo
- ext-pdo\_mysql

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~81 days

Total

13

Last Release

1630d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cb8ab20866bd4fb9928742bc2321fcfe89d5e8560d4abfdd52ba139072b487b?d=identicon)[transitive](/maintainers/transitive)

---

Top Contributors

[![transistive](https://avatars.githubusercontent.com/u/16435930?v=4)](https://github.com/transistive "transistive (32 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laudis-fiscal/health.svg)

```
[![Health](https://phpackages.com/badges/laudis-fiscal/health.svg)](https://phpackages.com/packages/laudis-fiscal)
```

###  Alternatives

[malios/php-to-ascii-table

A PHP library to generate plain text tables.

30118.8k1](/packages/malios-php-to-ascii-table)[samsara/fermat

A library providing math and statistics operations for numbers of arbitrary size.

653.1k3](/packages/samsara-fermat)[shrink0r/workflux

Finite state machine for php.

395.6k1](/packages/shrink0r-workflux)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
