tatter / reports
Report management framework for CodeIgniter 4
Fund package maintenance!
tattersoftware
paypal.me/tatter
Installs: 4 853
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 4
Open Issues: 7
Requires
- php: >=7.2
- tatter/handlers: ^2.0
Requires (Dev)
- codeigniter4/codeigniter4: dev-develop
- codeigniter4/codeigniter4-standard: ^1.0
- fzaninotto/faker: ^1.9@dev
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: ^3.5
- dev-develop
- v1.1.0
- v1.0.0
- dev-dependabot/composer/phpstan/phpstan-tw-1.9
- dev-dependabot/github_actions/actions/cache-3.0.11
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dependabot/composer/tatter/handlers-tw-3.0
- dev-dependabot/github_actions/shivammathur/setup-php-2.11.0
- dev-dependabot/composer/phpunit/phpunit-tw-9.5
- dev-master
- dev-analyze
This package is auto-updated.
Last update: 2024-11-04 09:24:40 UTC
README
Report management framework for CodeIgniter 4
Quick Start
- Install with Composer:
> composer require tatter/reports
- Create your reports in
App/Reports/
- Generate contents from CLI:
> php spark reports:generate
- 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.