Download the PHP package aichadigital/lara100 without Composer

On this page you can find all versions of the php package aichadigital/lara100. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lara100

Lara100 — Exact Decimal for Laravel

Latest Version Total Downloads Pipeline Coverage PHPStan level max PHP Version Laravel Version License

Development happens on gitlab.castris.com. The GitHub repository is a read-only distribution mirror: issues and pull requests opened there are not seen.

A Laravel package providing an immutable, scale-configurable exact decimal value object (FixedDecimal) and a matching Eloquent cast (FixedDecimalCast). Values are stored as plain integers (unscaled) in the database; the cast and value object handle all precision arithmetic using brick/math under the hood.

Why Lara100?

Floating-point arithmetic is not safe for monetary or fiscal values:

FixedDecimal eliminates this class of error entirely:

Arithmetic is exact at every step. The result serialises as a decimal string ('0.3'), not a float, so API consumers and hash-based fiscal systems (AEAT Verifactu, etc.) always receive the canonical value.

Requirements

Installation

No configuration file is required — lara100 ships with no publishable config.

Usage

1. Database schema

Store unscaled integers. The scale is declared at the model level, not in the column:

2. Model casts

Declare the cast with the scale as a colon-separated suffix. The scale is required; omitting it throws immediately rather than silently misinterpreting the column:

3. Reading and writing

The cast accepts only FixedDecimal|null on assignment. Scalars are rejected deliberately — callers must choose the conversion explicitly:

Assigning a raw scalar throws InvalidFixedDecimal — the strict contract prevents accidental precision loss at the boundary:

4. Constructing FixedDecimal

Recommended constructors:

Migration-only boundary (not for new code):

5. Arithmetic

All arithmetic produces a new FixedDecimal; the original is unchanged (immutable):

Available arithmetic: plus, minus, multipliedBy, dividedBy, toScale, negated, abs.

6. Comparison

7. Output

8. RoundingMode

lara100 ships its own RoundingMode enum — fully encapsulated from the underlying brick/math engine:

Case Description Typical use
HalfUp 0.5 rounds away from zero EU/Spain fiscal standard; default
HalfEven 0.5 rounds to nearest even Banker's rounding; accounting
HalfDown 0.5 rounds toward zero Conservative rounding
Up Always away from zero Always round up
Down Always toward zero (truncate) Always truncate
Ceiling Toward positive infinity
Floor Toward negative infinity

HalfUp is the European/Spanish fiscal standard and the default wherever lara100 accepts a rounding mode. HalfEven (banker's rounding) is the right choice for general accounting aggregations.

Positioning

lara100 is a Laravel-native, scale-aware exact decimal built on top of brick/math. It occupies a specific niche — here is when to reach for each option:

Library Abstraction Laravel cast Currency When to use
lara100 FixedDecimal (exact, scale-aware) Yes (FixedDecimalCast) No Prices, rates, fiscal amounts in Laravel — exact arithmetic without currency overhead
brick/math BigDecimal, BigInteger No No Raw exact arithmetic outside Laravel; lara100 builds on this
brick/money Money (amount + currency) No Yes Multi-currency systems, allocation, currency conversion
moneyphp/money Money (amount + currency) No Yes Same as brick/money; wider ecosystem adoption

Choose lara100 when:

Reach for brick/math directly when:

Reach for brick/money or moneyphp/money when:

lara100 encapsulates brick/math ^0.14.2 internally. The dependency is lightweight; brick types are not exposed except via the explicit toBigDecimal() escape hatch.

Comparison with Alternatives

Solution DB column PHP value Precision Laravel cast Multi-currency
lara100 FixedDecimal INTEGER (unscaled) FixedDecimal (exact) Exact Yes No
lara100 Base100Int INTEGER (cents) int Exact Yes No
brick/math (BigDecimal) BigDecimal (exact) Exact No No
brick/money INTEGER Money (exact + currency) Exact No Yes
moneyphp/money INTEGER Money (exact + currency) Exact No Yes
Native DECIMAL column DECIMAL(10,2) float Float — imprecise No No

Testing

Code Quality

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security Vulnerabilities

If you discover a security vulnerability, please send an e-mail to Abdelkarim Mateos Sanchez via [email protected].

Credits

License

The MIT License (MIT). Please see License File for more information.

About AichaDigital

AichaDigital is an IT company focused on IT services.


All versions of lara100 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4
brick/math Version ^0.14.2
illuminate/contracts Version ^12.0||^13.0
illuminate/database Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aichadigital/lara100 contains the following files

Loading the files please wait ...