Download the PHP package superbig/craft-reports without Composer
On this page you can find all versions of the php package superbig/craft-reports. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download superbig/craft-reports
More information about superbig/craft-reports
Files in superbig/craft-reports
Informations about the package craft-reports
Reports plugin for Craft CMS 3.x
Write reports with Twig.
Requirements
This plugin requires Craft CMS 3.0.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require superbig/craft-reports
- In the Control Panel, go to Settings → Plugins and click the “Install” button for Reports.
Reports Overview
Reports for Craft CMS and Craft Commerce makes it possible to write reports in Twig via a simple, fluent API.
It also makes it possible to setup report targets like email and (soon) Slack.
This way you can send reports directly to your target channels, either on demands or (soon) on a schedule.
Configuring Reports
You can override the options with a config file called reports.php:
Using Reports
You may use includes both for the Report Content and Settings fields.
The content Twig will be passed the following variables:
result
- aReportResult
model behind the scenesreport
- aReport
model behind the scenes
Report Example
To generate a list of users that has logged in the last 30 days:
Report Target Example
Report targets makes it possible to send the result of a report to target channels.
For now, email is supported, with Slack and more coming soon.
Example email body:
Note that you have access to both the reports attached to the target and the target itself.
Running report targets through Craft's console command
You can run any report targets through the console with the following command
The command can also receive the target's ID.
This way of running report targets is particularly useful if you want to run it from a cron job, or you have bigger reports that require more memory or runs longer than a normal web request can handle.
Reports Roadmap
Some things to do, and ideas for potential features:
- [x] Port Craft 2 version
- [x] Chainable content API
- [ ] Document content API
- [ ] Document report targets
- [ ] Fields support
- [ ] Charts support
- [ ] Widget support
- [ ] Scheduled reports
- [x] Email as report target
- [ ] Slack as report target
- [ ] Event for registering report target
- [ ] Template helpers
- [ ] Document helpers
- [ ] Report sources (think Slack slash command or CraftQL)
- [x] Run report targets via cli
- [x] Report targets dropdown in Reports index
- [x] Override title
- [x] Use queue job when running report targets
- [x] Screenshots
- [x] Permissions (Create, View, Export, Run, Delete)
Brought to you by Superbig