bit64/sars

South African Revenue Services (SARS) component for PHP

Maintainers

Details

github.com/bit64co/sars

Source

Issues

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/bit64/sars

dev-dev-master 2021-07-07 06:26 UTC

This package is auto-updated.

Last update: 2025-12-07 22:04:11 UTC


README

Copyright (c) 2021-current Bit 64 Solutions Pty Ltd (bit64.co)

This component provides a tax calculator microservice specific to the South African Revenue Services (SARS) for PHP projects.

Usage

Installation via Composer

$ composer require bit64/sars

Instantiate the API class

use Bit64\SARS\Api;

$api = new Api();

Income Tax Calculator

Get the income tax calculator

$incomeTax = $api->IncomeTax();

Default age is 30 years old

$grossMonthly = 25000;

$paye = $incomeTax->calculateMonthlyTax($grossMonthly);

echo sprintf('R%0.2f', $paye);
// Output R3749.17

Specify age and context date

$grossWeekly = 12000;
$age = 68;
$contextDate = '2021-05-30';

$paye = $incomeTax->calculateWeeklyTax($grossWeekly, $age, $contextDate);

echo sprintf('R%0.2f', $paye);
// Output R2751.23