Download the PHP package ariefng/filament-calculator without Composer

On this page you can find all versions of the php package ariefng/filament-calculator. 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 filament-calculator

Filament Calculator

Latest Version

Provides a calculator modal action for Filament TextInput fields in Filament Admin Panel.

Note: Supports Filament v4 and v5. For changes and updates, see the CHANGELOG.

Table of Contents

Features

Requirements

Installation

Install the package via Composer:

Publish the package configuration (optional):

Publish the package translations (optional):

Currently, the package ships with translations for English (en) and Indonesian (id) only.

If you are using Filament Panels, register the plugin in your panel provider:

Quick Start

Register the plugin in your Filament panel, then attach the calculator action to your form field.

Usage

Attach the calculator action to a TextInput using prefixAction() or suffixAction():

Since CalculatorAction extends Filament's default Action, you can use any supported action customization methods on it. If you place the calculator inside another Filament modal or slide-over form, you may want the calculator modal to open on top of the parent modal instead of closing and reopening the parent. Filament documents this pattern here:

https://filamentphp.com/docs/5.x/actions/modals#overlaying-child-action-modals-on-top-of-parent-action-modals

Example:

Example preview:

The calculator shows the current expression on the first line and the live computed result on the second line. Both lines use locale-aware thousands and decimal separators in the modal display to keep larger values readable while typing. Pressing Insert writes the computed result back to the field, so users do not need to press the equals button first.

When the field already has a value, opening the calculator again will preload that value instead of resetting to 0. If the field is blank, the calculator falls back to 0.

When the calculator is used with Filament numeric inputs, the inserted value is normalized before it is written to the field:

This keeps the inserted value compatible with Filament numeric fields and browser type="number" inputs, even if the calculator UI is currently displaying values like 1.000,50.

Configuration

The published config file looks like this:

Available options:

Example:

Styling

The calculator styles are automatically loaded globally - no need to run php artisan filament:assets.

If you need to customize the calculator's appearance, you can override the CSS by publishing the package's views and adding your custom styles to your application's CSS file.

The calculator modal uses Filament's built-in color variables. By default, the operator buttons and evaluate button use the gray color alias, and you can switch them to another Filament color alias through operator_buttons.color.

Decimal separator behavior follows the active locale by default. For example, id locales use , while en locales use .. The calculator display also applies locale-aware thousands separators while values are being entered. You can override the decimal behavior through the decimal_separator config option.

The grouped formatting is display-only inside the calculator modal. Inserted values are always written back as plain numeric strings without thousands separators, and comma decimals are normalized to dots before dispatching the input and change events.

When reopening the calculator, the current field value is preferred when initial_value is set to 'field'. If you prefer a clean calculator every time, set initial_value to 0 or 'zero'.

Calculator insertion also supports TextInput components inside Filament Repeater items by targeting the field's unique state path instead of relying only on the DOM input id.

Testing

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Security summary from a Claude Opus 4.6 code review:

Category Status
XSS No vulnerabilities
Code injection Protected (custom parser, no eval)
CSRF N/A (no server-side mutations)
Input validation Proper (max digits, whitelisted separators)

This summary is informational and does not replace responsible disclosure. If you discover a vulnerability, please report it through the security policy linked above.

Credits

This plugin was built entirely with Codex.

License

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


All versions of filament-calculator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/actions Version ^4.0|^5.0
filament/forms Version ^4.0|^5.0
filament/support Version ^4.0|^5.0
spatie/laravel-package-tools Version ^1.15.0
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 ariefng/filament-calculator contains the following files

Loading the files please wait ...