---
title: "Artisan commands — Reports for Laravel | Roundly"
description: "Prune old settled reports, list per-subject open report counts, and inspect the active configuration with php artisan about."
url: https://roundly-consulting.com/open-source/docs/reports-for-laravel/commands
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Reports for Laravel](https://roundly-consulting.com/open-source/docs/reports-for-laravel.md)

# Artisan commands

```bash
# 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).
# --threshold takes a whole number too; abc, -3 or 2.9 is refused and nothing is listed.
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:

```php
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:

```php
// 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 takes a whole number of 0 or more — anything else (abc, -3, 2.9) is refused with an error and no table is printed, like --days on reports:prune. 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:

```bash
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](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

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

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/reports-for-laravel.md)
