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

Artisan commands

# Prune resolved/rejected/closed reports older than N days (soft-delete by default).
php artisan reports:prune --days=30

# Permanently delete instead of soft-deleting.
php artisan reports:prune --days=30 --force

# When prune_after_days is configured, --days is optional.
php artisan reports:prune

# --days takes a whole number; anything else (abc, -5, 1.5) is refused and nothing is pruned.

# List per-subject open report counts (optionally only subjects with at least N).
php artisan reports:recount
php artisan reports:recount --threshold=5

reports:prune

A thin wrapper over Reports::prune(): it deletes Resolved, Rejected and Closed reports whose created_at is older than the cutoff. It soft-deletes by default; --force deletes permanently, including rows an earlier soft prune trashed. --days takes a whole number; anything else (abc, -5, 1.5) is refused and nothing is pruned. Without --days it uses prune_after_days, and exits with an error when neither is set. Call the same thing from code:

use RoundlyConsulting\Reports\Facades\Reports;

Reports::prune(30);               // soft-delete terminal reports older than 30 days → int
Reports::prune(30, force: true);  // delete permanently (also purges already-trashed rows)
Reports::prune();                 // uses reports.prune_after_days — throws MissingPruneWindowException without one

Schedule it to keep the table lean:

// routes/console.php
use Illuminate\Support\Facades\Schedule;

Schedule::command('reports:prune')->daily(); // uses prune_after_days

reports:recount

Lists every subject with open (Pending or InReview) reports as a table — subject type, subject id and open count — highest count first. --threshold lists only subjects with at least that many open reports; the default minimum is 1. It reads counts and writes nothing.

php artisan about

The package adds a Reports section to php artisan about: model, table, key type, reason count, duplicate prevention, strict transitions, threshold, pruning and moderation defaults; an invalid threshold or prune_after_days shows as INVALID. It never prints reason slugs or stored reports:

php artisan about --only=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 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.