https://github.com/tattersoftware/codeigniter4-reports
Report management framework for CodeIgniter 4
https://github.com/tattersoftware/codeigniter4-reports
Last synced: about 1 year ago
JSON representation
Report management framework for CodeIgniter 4
- Host: GitHub
- URL: https://github.com/tattersoftware/codeigniter4-reports
- Owner: tattersoftware
- License: mit
- Created: 2019-05-20T18:04:35.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-11-04T05:01:19.000Z (over 3 years ago)
- Last Synced: 2025-03-26T09:44:43.870Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tatter\Reports
Report management framework for CodeIgniter 4
## Quick Start
1. Install with Composer: `> composer require tatter/reports`
2. Create your reports in `App/Reports/`
3. Generate contents from CLI: `> php spark reports:generate`
4. Access report content: `$reports = new \App\Reports\MyReport(); $results = $reports->get();`
## Features
Provides a concise, non-intrusive framework for writing database reports for CodeIgniter 4
## Installation
Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities
and always be up-to-date:
* `> composer require tatter/reports`
Or, install manually by downloading the source files and adding the directory to
`app/Config/Autoload.php`.
## Create reports
Once the library is included all the resources are ready to go and you are ready to start
making your report classes. Reports are detected across any namespace so can come from
your `App\Reports` namespace or any module under **Reports**. See `ReportInterface` for
requirements when writing a report class.
## Generate results
Once all the report classes are written, use the command-line interface to generate report results:
`> php spark reports:generate`
Each report class handles checking for missing report values so this command can be run
routinely (e.g. by a daily cron).
## Access results
Load the report class of choice and then pull whatever contents you need using its `get()`
method. Called without parameters `get()` will return all contents straight from the
database. Optionally you may specify criteria to the database query, e.g.:
```
$results = $reports->get([
'user_id' => 56,
'created_at >=' => '2019-03-01',
]);
```
Other parameters to `get()` allow recursive result grouping (e.g.
`$results[user_id][date] => contents`) and ordering of returned content.