PHPackages                             atk4/report - 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. [Framework](/categories/framework)
4. /
5. atk4/report

AbandonedArchivedLibrary[Framework](/categories/framework)

atk4/report
===========

Agile Data - Report Extension

1.0.4(5y ago)36476[8 issues](https://github.com/atk4/report/issues)[1 PRs](https://github.com/atk4/report/pulls)mitPHPPHP &gt;=7.3.0

Since Apr 3Pushed 4y ago7 watchersCompare

[ Source](https://github.com/atk4/report)[ Packagist](https://packagist.org/packages/atk4/report)[ Docs](http://agiletoolkit.org/data/extension/report)[ RSS](/packages/atk4-report/feed)WikiDiscussions develop Synced today

READMEChangelog (4)Dependencies (5)Versions (10)Used By (0)

⚠️ repo was integrated into [atk4/data](https://github.com/atk4/data) ⚠️
========================================================================

[](#️-repo-was-integrated-into-atk4data-️)

Agile Data - Reporting Add-on
=============================

[](#agile-data---reporting-add-on)

[![Build](https://github.com/atk4/report/workflows/Unit%20Testing/badge.svg)](https://github.com/atk4/report/workflows/Unit%20Testing/badge.svg)

This extension for Agile Data implements advanced reporting capabilities:

- Aggregate models. Provide grouping of existing model.
- Union models. Combine one or multiple models.

**IMPORTANT - This repository is discontinued and functionality of Aggregate and Union models will be moved to  starting from version 2.3.0**

Installation and Usage
----------------------

[](#installation-and-usage)

This repository is now public and available under MIT license, so to install:

```
composer require atk4/report
```

You may need to adjust your `minimum-stability` setting.

### UnionModel

[](#unionmodel)

Create a new model that combines data from scopes of several nested models. Will help you map fields properly so that resulting model have the columns you want. In next example you would need to define Purchase and Sale models yourself. See ):

```
$m = new \atk4\report\UnionModel($db);
$m->addNestedModel(new Purchase(), [
    'ref_no'        => '[ref_no]',          // mapping fields is optional
    'date'          => '[purchase_date]',   // you can alias like this
    'contact'       => 'concat("From: ", [contractor_from])',
]);                                         // use expressions
$m->addNestedModel(new Sale(), [
    'date'          => '[sale_date]',       // this way we have one column for dates
    'contact'       => 'concat("To: ", [contractor_to])',
]);
$m->setOrder(['date']);                     // sorts resulting union model

$m->addField('date', ['caption' => 'Date', 'type' => 'date']);
     // now add union-based models here.

$m->addField('contact', ['caption' => 'Supplier/Payee']);
$m->addField('ref_no', ['caption' => 'Document No']);
$m->addField('amount', ['caption' => 'Net Amount', 'type' => 'money']);
     // if association in nested model is not explicitly defined, will
     // use field. If no field is found, will use expression: "null"

$m->join('country', 'country_id')
    ->addField('country', 'name');
     // Union Model extends \atk4\data\Model so you can use addField and addExpression

// $m->groupBy('country', ['amount'=>'sum([]')])
// groupBy works like in GroupModel, next example for usage.

$table->setModel($m);
```

### GroupModel

[](#groupmodel)

Creates a new model containing aggregate data from your existing model. Note that you can combine UnionModel and GroupModel recursively.

```
$m = new \smbo\GroupModel(new Sale($db));
$m->groupBy(['contractor_to', 'type'], [      // groups by 2 columns
    'c'                     => 'count(*)',    // defines aggregate formulas for fields
    'qty'                   => 'sum([])',     // [] refers back to qty
    'total'                 => 'sum([amount])', // can specify any field here
]);

$m->addFields(['vat_registered', ['vat_no', 'caption' => 'VAT No']]);
    // add 2 more fields which will bypass aggregation.

$m->getElement('total')->type = 'money';
    // change the type
```

Documentation
-------------

[](#documentation)

Current Status
--------------

[](#current-status)

Implementation is complete, but a better documentation and more examples needed. Also some cleanups in the code are welcome!

License: MIT
------------

[](#license-mit)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 63% 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 ~78 days

Total

5

Last Release

2085d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.2.0

1.0.3PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/426ad318d07e7685454f7e449a9d0c9f005b83aef0777558d97d854ff9c28a5a?d=identicon)[romaninsh](/maintainers/romaninsh)

---

Top Contributors

[![DarkSide666](https://avatars.githubusercontent.com/u/1969119?v=4)](https://github.com/DarkSide666 "DarkSide666 (63 commits)")[![romaninsh](https://avatars.githubusercontent.com/u/453929?v=4)](https://github.com/romaninsh "romaninsh (34 commits)")[![alexlvcom](https://avatars.githubusercontent.com/u/15180771?v=4)](https://github.com/alexlvcom "alexlvcom (1 commits)")[![gowrav-vishwakarma](https://avatars.githubusercontent.com/u/1007955?v=4)](https://github.com/gowrav-vishwakarma "gowrav-vishwakarma (1 commits)")[![mvorisek](https://avatars.githubusercontent.com/u/2228672?v=4)](https://github.com/mvorisek "mvorisek (1 commits)")

---

Tags

agileatk4phpreportframeworkdataAgilereportcrudaggregationgroup

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/atk4-report/health.svg)

```
[![Health](https://phpackages.com/badges/atk4-report/health.svg)](https://phpackages.com/packages/atk4-report)
```

###  Alternatives

[atk4/ui

Agile UI - Web Component Framework written in PHP

461541.9k34](/packages/atk4-ui)[amranidev/scaffold-interface

A Smart CRUD Generator For Laravel

91920.8k1](/packages/amranidev-scaffold-interface)[atk4/mastercrud

Multi-level CRUD system component for ATK UI

109.7k](/packages/atk4-mastercrud)[atk4/login

Login and User module for Agile UI

2518.5k5](/packages/atk4-login)[atk4/api

Agile API - Extensible API server in PHP for Agile Data

143.7k1](/packages/atk4-api)[atk4/chart

Chart.js for Agile UI

1214.2k](/packages/atk4-chart)

PHPackages © 2026

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