NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
Reports for Laravel

Status lifecycle

Every report carries a Status enum and starts as Pending:

CaseValueOpen or terminal
Status::PendingpendingOpen — the starting status.
Status::InReviewin_reviewOpen — a moderator is looking at it.
Status::ResolvedresolvedTerminal — the report was upheld.
Status::RejectedrejectedTerminal — no violation found.
Status::ClosedclosedTerminal — a resolved report, filed away.

Transitions

Moves are guarded by a transition table:

FromAllowed next
PendingInReview, Resolved, Rejected
InReviewResolved, Rejected, Pending
ResolvedClosed, Pending
RejectedPending
ClosedPending
use RoundlyConsulting\Reports\Enums\Status;
use RoundlyConsulting\Reports\Facades\Reports;

$report->status;                                 // Status::Pending for a new report
Reports::review($report);                        // → InReview — fires ReportStatusChanged
Reports::review($report);                        // no-op when already in that status
Reports::changeStatus($report, Status::Closed);  // InReview → Closed is not declared: throws when strict

$report->changeStatusTo(Status::Pending);        // model shorthand — same path through the manager

Every move runs ChangeReportStatusAction: it fires ReportStatusChanged on every real change and is a no-op when the report is already in the target status. With strict_transitions on, an undeclared move throws InvalidStatusTransitionException; switch it off to allow any move.

Status helpers

Status::transitions();                              // the full transition table
Status::Pending->allowedTransitions();              // [InReview, Resolved, Rejected]
Status::Resolved->canTransitionTo(Status::Closed);  // true
Status::Rejected->isTerminal();                     // true — Resolved, Rejected, Closed
Status::InReview->isOpen();                         // true — Pending, InReview
Status::open();                                     // [Status::Pending, Status::InReview]
Status::InReview->label();                          // "In Review"

Status adopts the enums Helpers trait as well, so Status::toOptions() and Status::validationRule() are ready for filters and admin forms.

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 crypto

By 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.