PHP code example of azaharizaman / nexus-reporting
1. Go to this page and download the library: Download azaharizaman/nexus-reporting library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
azaharizaman / nexus-reporting example snippets
use Nexus\Reporting\Services\ReportManager;
use Nexus\Reporting\ValueObjects\ReportFormat;
use Nexus\Reporting\ValueObjects\ScheduleType;
use Nexus\Reporting\ValueObjects\ReportSchedule;
$reportId = $reportManager->createReport([
'name' => 'Monthly Sales Report',
'query_id' => $analyticsQueryId,
'owner_id' => $userId,
'format' => ReportFormat::PDF,
'schedule' => new ReportSchedule(
type: ScheduleType::MONTHLY,
cronExpression: '0 9 1 * *', // 9 AM on 1st of month
startsAt: new \DateTimeImmutable('2025-12-01'),
endsAt: null,
maxOccurrences: null
),
'recipients' => [$customer, $manager],
'template_config' => [
'logo_path' => 'storage://logos/company.png',
'css_path' => 'storage://templates/invoice.css'
]
]);