Every step of the lifecycle fires an event:
| Event | Properties | Fires when |
|---|---|---|
ReportCreated | report | A report row is created (the model’s created event). |
ReportStatusChanged | report, statusBefore, statusNow | A status actually changes — changeStatus(), review(), close(), changeStatusTo(), resolve / reject or the moderation listener. |
ReportResolved | report | A report is resolved — directly or through moderation. |
ReportRejected | report | A report is rejected — directly or through moderation. |
ReportThresholdReached | subject, count, threshold | A new report brings a subject’s open report count to exactly the configured threshold — once per crossing. |
use Illuminate\Support\Facades\Event;
use RoundlyConsulting\Reports\Events\ReportCreated;
use RoundlyConsulting\Reports\Events\ReportStatusChanged;
Event::listen(function (ReportCreated $event): void {
$event->report;
});
Event::listen(function (ReportStatusChanged $event): void {
$event->statusBefore; // Status
$event->statusNow; // Status
});ReportCreated is wired to the model’s created event, so it also fires for reports created by the factory. Every event uses Dispatchable and SerializesModels, so queued listeners work out of the box.
The package itself listens to the approvals ApprovalRequestResolved event (via SyncReportStatusFromApproval) to settle moderated reports.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.