PHPackages                             omaralalwi/laravel-taxify - 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. omaralalwi/laravel-taxify

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

omaralalwi/laravel-taxify
=========================

Laravel Taxify provides a set of helper functions and classes to simplify tax (VAT) calculations within Laravel applications. that allow developers to easily integrate tax calculation functionalities into their projects. it's offers a straightforward and efficient solution Designed to streamline the process of handling taxes.

2.0.4(11mo ago)472.2k↓52.9%5MITPHPPHP ^8.0|^8.1|^8.2|^8.3CI passing

Since Feb 23Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/omaralalwi/laravel-taxify)[ Packagist](https://packagist.org/packages/omaralalwi/laravel-taxify)[ Docs](https://github.com/omaralalwi/laravel-taxify)[ RSS](/packages/omaralalwi-laravel-taxify/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (2)Versions (21)Used By (0)

Laravel Taxify
==============

[](#laravel-taxify)

 [ ![Laravel Taxify](https://raw.githubusercontent.com/omaralalwi/laravel-taxify/master/public/images/taxify.jpg) ](https://github.com/omaralalwi/laravel-taxify)

set of helper functions and classes to simplify tax (VAT) calculations within Laravel applications. that allow developers to easily integrate tax calculation functionalities into their projects with multi tax profiles settings and (fixed, percentage) ways. it's offers a straightforward and efficient solution Designed to streamline the process of handling taxes.

Requirements
------------

[](#requirements)

`Laravel 8.x or up` , for version 2.x .

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

[](#installation)

```
composer require omaralalwi/laravel-taxify
```

publish the package's configuration file:

```
php artisan vendor:publish --tag=taxify
```

Compatibility
-------------

[](#compatibility)

For applications running Laravel versions `7.x` and older, use version `1.0.4`.

```
composer require omaralalwi/laravel-taxify:^1.0.4
```

Usage
-----

[](#usage)

### Available Helper Functions

[](#available-helper-functions)

laravel taxify many of helper functions to simplify usage.

- `calculateTax()`.
- `calculateTaxForCollection()`.
- `getTaxAmount()` .
- `getTaxRate()` .
- `getTaxType()` .
- `getTaxRateAsPercentage()` .

---

### calculate tax for an amount:

[](#calculate-tax-for-an-amount)

- use `calculateTax` to get Tax As object (default).

```
$amount = 250;
$taxAmount = calculateTax($amount,'profileName')->tax_amount; // 37.5
```

---

**Another way to get Detailed Result**.

```
$amount = 250;
$tax = calculateTax($amount,'profileName');
```

Result (Object)

```
 $tax = {
    "amount_with_tax": 287.5,
    "tax_amount": 37.5,
    "tax_rate": 0.15,
  }
```

---

**Note**: the second param refer to profile, we mad it null to take default profile, second param can take (`default`, null,''') all three values mean `default`.

---

### Calculate tax for a collection of amounts:

[](#calculate-tax-for-a-collection-of-amounts)

like calculateTax but this for a many amounts .

- use `calculateTaxForCollection` to get a tax for a collection of amounts by passing amounts as array (first param) -&gt; Result wanted as object (default).

```
// you can pass number as float or integer
$productAmount = 250;
$featureAmount = 70.5;
$warrantyAmount = 30.60;
$chargeAmount = 90;

$tax = calculateTaxForCollection([$productAmount,$featureAmount, $warrantyAmount, $chargeAmount]);
```

Result (object)

```
$tax = {
    "amount_with_tax": 507.265,
    "tax_amount": 66.165,
    "tax_rate": 0.15,
  }
```

```
$taxAmount = $tax->tax_amount // 66.165
```

### Get Tax Amount as numeric value

[](#get-tax-amount-as-numeric-value)

- use `getTaxAmount` to get Tax Amount as number

```
$amount = 250;
getTaxAmount($amount); // Result 25
```

---

### Get tax rate or tax amount:

[](#get-tax-rate-or-tax-amount)

- use `getTaxRate` to get Tax Rate or amount (according to tax type for specified profile in config file)

```
getTaxRate()
// Result 0.15
```

```
getTaxRate('sales') // fore specific profile
// Result 50 , here the result is fixed number because the profile type is fixed amount Not percentage
```

if profile tax type is `fixed` will return the amount (read the tax rate as amount), else will return the tax rate.

**Note**: for default profile no need to pass `profileName.

---

### Get tax type:

[](#get-tax-type)

- use `getTaxType` to you can get Tax Type

```
getTaxType('profileName')
// Result: fixed or percentage // depend on profile settings
```

---

### Get tax rate as Percentage number (10%, 15%) - for percentage profiles Only:

[](#get-tax-rate-as-percentage-number-10-15---for-percentage-profiles-only)

you can get Tax Rate As Percentage

- you can get a tax rate percentage (for percentage type only)

```
getTaxRateAsPercentage();  // Result '10.00%'
```

**Note**: for default profile no need to pass it

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

after you published config file .

You can configure Laravel Taxify by adding the following default configuration keys to your `.env` file. If you do not add these, the default values will be used.

For a percentage tax type:

```
DEFAULT_TAXIFY_PROFILE="default"
TAXIFY_DEFAULT_RATE="0.10"
TAXIFY_DEFAULT_TYPE="percentage"
```

example configuration for fixed tax type:

```
DEFAULT_TAXIFY_PROFILE="default"
TAXIFY_DEFAULT_RATE=50
TAXIFY_DEFAULT_TYPE="fixed"
```

**Note:** The `TAXIFY_DEFAULT_RATE` is a number representing the rate when the type is `percentage` or the amount when type is `fixed`.

You can add more than one of tax profile in config/taxify.php .

Features
--------

[](#features)

- Calculate tax for individual amounts or a collection of amounts
- Retrieve tax amount, rate, and type for any profile as individual.
- Retrieve tax `amount_with_tax` and `tax_amount` and `tax_rate` for any profile as individual for one amount or a collection of amounts
- Get tax rate as a percentage (for percentage type only)
- Customizable configuration options through environment variables easy.
- helper functions easy-to-use.
- support all php and laravel versions.
- Exception Handling: Robust error handling to ensure smooth operation and easy debugging.
- Logging: Automatic logging of errors and exceptions for better error tracking and debugging.
- Unit Tests.

### Testing

[](#testing)

```
php artisan test --filter TaxifyTest
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

TODO
----

[](#todo)

this todo list , contain the tasks that we planning to working on them, you can choose one of them and develop it if you want to contribute.

### Security

[](#security)

If you discover any security related issues, please email `omaralwi2010@gmail.com`.

Credits
-------

[](#credits)

- [omar alalwi](https://github.com/omaralalwi)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

📚 Helpful Open Source Packages
------------------------------

[](#-helpful-open-source-packages)

- [![lexi translate](https://raw.githubusercontent.com/omaralalwi/lexi-translate/master/public/images/lexi-translate-banner.jpg) Lexi Translate ](https://github.com/omaralalwi/lexi-translate) simplify managing translations for multilingual Eloquent models with power of morph relationships and caching .
- [![laravel Taxify](https://raw.githubusercontent.com/omaralalwi/Gpdf/master/public/images/gpdf-banner-bg.jpg) Gpdf ](https://github.com/omaralalwi/Gpdf) Open Source HTML to PDF converter for PHP &amp; Laravel Applications, supports Arabic content out-of-the-box and other languages..
- [![laravel Deployer](https://raw.githubusercontent.com/omaralalwi/laravel-deployer/master/public/images/deployer.jpg) **laravel Deployer** ](https://github.com/omaralalwi/laravel-deployer) Streamlined Deployment for Laravel and Node.js apps, with Zero-Downtime and various environments and branches.
- [![laravel Trash Cleaner](https://raw.githubusercontent.com/omaralalwi/laravel-trash-cleaner/master/public/images/laravel-trash-cleaner.jpg) **laravel Trash Cleaner** ](https://github.com/omaralalwi/laravel-trash-cleaner)clean logs and debug files for debugging packages.
- [![laravel Trash Cleaner](https://raw.githubusercontent.com/omaralalwi/laravel-time-craft/master/public/images/laravel-time-craft.jpg) **laravel Time Craft** ](https://github.com/omaralalwi/laravel-time-craft)simple trait and helper functions that allow you, Effortlessly manage date and time queries in Laravel apps.
- [![Laravel Startkit](https://raw.githubusercontent.com/omaralalwi/laravel-startkit/master/public/screenshots/backend-rtl.png) **Laravel Startkit** ](https://github.com/omaralalwi/laravel-startkit) Laravel Admin Dashboard, Admin Template with Frontend Template, for scalable Laravel projects.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance50

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

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 ~126 days

Total

5

Last Release

357d ago

Major Versions

1.0.4 → 2.0.12024-02-25

PHP version history (2 changes)1.0.4PHP ^7.4

2.0.1PHP ^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/46733da79a34ff686b036a09af1dcc6d21054aee25a5e029500dc87d3c69ba89?d=identicon)[WatheqAlshowaiter](/maintainers/WatheqAlshowaiter)

![](https://www.gravatar.com/avatar/92882431481b621f6509ff259dd600e327c27fc77adcba4fcc7177659059c9a8?d=identicon)[omaralalwi](/maintainers/omaralalwi)

---

Top Contributors

[![omaralalwi](https://avatars.githubusercontent.com/u/25439498?v=4)](https://github.com/omaralalwi "omaralalwi (98 commits)")

---

Tags

laravellaravel-packagelaravel-taxphp-taxtaxtax-calculationstax-calculatortax-packagevatvat-packagetax calculationvat calculationlaravel-helperslaravel-librarylaravel-helperlaravel-facadelaravel-vatomaralalwilaravel-taxifyVAT-packageTax-packagephp-Tax-packagelaravel-Tax-packageVAT-helpertax-helperLaravel-VAT-helper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/omaralalwi-laravel-taxify/health.svg)

```
[![Health](https://phpackages.com/badges/omaralalwi-laravel-taxify/health.svg)](https://phpackages.com/packages/omaralalwi-laravel-taxify)
```

###  Alternatives

[mpociot/vat-calculator

EU VAT calculation, the way it should be.

1.3k4.2M23](/packages/mpociot-vat-calculator)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13871.7k2](/packages/ralphjsmit-laravel-helpers)[omaralalwi/laravel-trash-cleaner

Clean Laravel debug/log files (Debugbar, Clockwork), compiled views and frontend build artifacts, with optional rebuild and scheduling.

214.0k](/packages/omaralalwi-laravel-trash-cleaner)[omaralalwi/php-builders

sample php traits to add ability to use builder design patterns with easy in PHP applications

153.1k1](/packages/omaralalwi-php-builders)[shipsaas/laravel-inbox-process

Inbox pattern process implementation for your Laravel Applications

132.5k](/packages/shipsaas-laravel-inbox-process)

PHPackages © 2026

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