PHPackages                             saeid-khaleghi/police-reporter - 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. saeid-khaleghi/police-reporter

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

saeid-khaleghi/police-reporter
==============================

A package for securely reporting business transactions to the New Zealand Police for compliance and transparency purposes.

1.6.0(1y ago)0100MITPHP

Since Oct 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Saeid-Khaleghi/police-reporter)[ Packagist](https://packagist.org/packages/saeid-khaleghi/police-reporter)[ RSS](/packages/saeid-khaleghi-police-reporter/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (1)Versions (15)Used By (0)

Business Transaction Reporting for New Zealand Police
=====================================================

[](#business-transaction-reporting-for-new-zealand-police)

This package will help you generate an XML file for New Zealand Police reports.

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

[](#installation)

You can install this package via [Composer](https://getcomposer.org/):

```
composer require saeid-khaleghi/police-reporter
```

Usage
-----

[](#usage)

```
use SaeidKhaleghi\PoliceReporter\XMLGenerator;

$transactions = Transaction::all();

$reporter = XMLGenerator::create($transactions)->writeToFile($path);
```

You can add your models directly by implementing the `\SaeidKhaleghi\PoliceReporter\Contracts\Reportable` interface.

```
use SaeidKhaleghi\PoliceReporter\Contracts\Reportable;

class Transaction extends Model implements Reportable
{
    public function toReportTransaction(): Url | string | array
    {
        return (new ReportTransaction($this))->transaction();
    }
}
```

Your PoliceReportTransactionMaker should be like this:

```
use SaeidKhaleghi\PoliceReporter\Tags\Person;
use SaeidKhaleghi\PoliceReporter\Tags\Signatory;
use SaeidKhaleghi\PoliceReporter\Tags\ToAccount;
use SaeidKhaleghi\PoliceReporter\Tags\FromAccount;
use SaeidKhaleghi\PoliceReporter\Tags\TransactionTo;
use SaeidKhaleghi\PoliceReporter\Tags\TransactionFrom;
use SaeidKhaleghi\PoliceReporter\Tags\Transaction as ReportTransaction;

class PoliceReportTransactionMaker
{
    private Transaction $transaction;

    public function __construct(Transaction $transaction)
    {
        $this->transaction = $transaction;
    }

    public function transactionFrom()
    {
        return new TransactionFrom('From fund code', 'From country');
    }

    public function fromAccount()
    {
        return new FromAccount(env('APP_FORMAL_NAME'), env('APP_INSTITUTION_CODE'), 'Branch', 'Account', 'Account_name');
    }

    public function accountRelatedPerson()
    {
        $identification = new PersonIdentification('Type', 'id_number', 'country', 'Expiry date');
        $user = new Person('Gender', 'First name', 'Last name', 'Birthdate', 'Id Type',  'Id number', 'Issue Country (Two-Letter Country Code)', $identification);

        return new AccountRelatedPerson($user);
    }

    public function transactionTo()
    {
        return new TransactionTo('To fund code', 'Destination Currency', 'Destination amount', 'To country');
    }

    public function toAccount()
    {
        return ToAccount::create('Institution name', 'Account', 'Account_name', 'swift');
    }

    public function transaction()
    {
        return ReportTransaction::create($this->transfer->reference, $this->transfer->updated_at, $this->transfer->origin_amount)
            ->addFromMyClient($this->transactionFrom()->addFromAccount($this->fromAccount()->addAccountRelatedPerson($this->accountRelatedPerson())))
            ->addTransactionTo($this->transactionTo()->addToAccount($this->toAccount()));
    }
}
```

The generated XML will look similar to this:

```

            TW01182606-101023
            web
            2023-10-11T11:03:51
            BA
            129.06

                N

                    Your Company
                    12345
                    web
                    ABC123
                    Saeid Khaleghi

                                M
                                Saeid
                                Khaleghi
                                1980-06-24T00:00:00
                                ZYXWV123

                                        A
                                        ZYXWV123
                                        NZ

                NZ

                N

                    BNZ
                    BSIRIRTH
                    ABCDEFGHIJK1234567890
                    RECIPIENT NAME

                US

            ...

```

Credits
-------

[](#credits)

- [Saeid Khaleghi](https://github.com/saeid-khaleghi)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Recently: every ~10 days

Total

14

Last Release

557d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/823090fd96e055df2e2f6af5a93b492f5370d5995889465102827f4d1d246216?d=identicon)[calampolow](/maintainers/calampolow)

---

Top Contributors

[![Saeid-Khaleghi](https://avatars.githubusercontent.com/u/13361616?v=4)](https://github.com/Saeid-Khaleghi "Saeid-Khaleghi (14 commits)")

---

Tags

businessreportingcompliancetransactionNew Zealand Police

### Embed Badge

![Health badge](/badges/saeid-khaleghi-police-reporter/health.svg)

```
[![Health](https://phpackages.com/badges/saeid-khaleghi-police-reporter/health.svg)](https://phpackages.com/packages/saeid-khaleghi-police-reporter)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402860.1k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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