---
title: "Configuration — Reports for Laravel | Roundly"
description: "Every config key and its default — model, table, key type, reasons, duplicate prevention, strict transitions, threshold, pruning and moderation."
url: https://roundly-consulting.com/open-source/docs/reports-for-laravel/configuration
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)

# Configuration

The package works with zero published configuration — the defaults are merged in automatically. The published config/reports.php:

```php
return [
    'model' => RoundlyConsulting\Reports\Models\Report::class,
    'table' => 'reports',
    'key_type' => env('REPORTS_KEY_TYPE', 'bigint'),
    'primary_key_type' => env('REPORTS_PRIMARY_KEY_TYPE', 'bigint'),
    'default_reason' => 'other',
    'reasons' => ['spam', 'abuse', 'harassment', 'inappropriate', 'misinformation', 'other'],
    'allow_unknown_reasons' => false,
    'prevent_duplicates' => true,
    'duplicate_scope' => 'open',
    'strict_transitions' => true,
    'threshold' => null,
    'prune_after_days' => null,
    'moderation' => [
        'default_rule' => 'unanimous',
        'default_quorum' => null,
    ],
];
```

## Every key

| Key | Default | Purpose |
| --- | --- | --- |
| `model` | Report::class | The Eloquent model that stores reports. Point it at your own Report subclass; anything else throws InvalidConfigurationException. |
| `table` | reports | The table reports live in — read by the model and by the migration. A string; a blank value is not set, so reports applies. |
| `key_type` | bigint | Morph key type for reporter, reported and resolved\_by: bigint, uuid or ulid. Env REPORTS\_KEY\_TYPE; unset or blank reads as bigint, any other value throws InvalidConfigurationException. |
| `primary_key_type` | bigint | Type of the reports table’s own id: bigint, uuid or ulid — read by the migration and the Report model. Env REPORTS\_PRIMARY\_KEY\_TYPE; match it to approvals.key\_type when you moderate (see Database schema & key types). Unset or blank reads as bigint, any other value throws InvalidConfigurationException. |
| `default_reason` | other | The reason used when a report is filed without one (a string; a blank value is not set, so other applies). |
| `reasons` | the six Reason slugs | The allowed reason slugs — a non-empty list of non-empty strings; a blank value is not set, so the Reason slugs apply. Add your own custom slugs here. |
| `allow_unknown_reasons` | false | When true, any reason slug is accepted without validation. |
| `prevent_duplicates` | true | Stop the same reporter or guest from reporting the same subject twice. Filings against one subject are serialized, so a double-submit can’t slip through. |
| `duplicate_scope` | open | open dedupes against open reports only; any against every report ever filed. Any other value throws. |
| `strict_transitions` | true | Allow only declared status transitions; illegal moves throw. |
| `threshold` | null | ReportThresholdReached fires when a new report brings a subject’s open count to exactly this number — once per crossing. null, blank (not set) or 0 disables it; anything else that is not a whole number throws InvalidConfigurationException when a report is filed. |
| `prune_after_days` | null | Default age in days for Reports::prune() / reports:prune when no window is given. null or blank (not set) requires one — MissingPruneWindowException, never a zero-day window; anything else that is not a whole number throws InvalidConfigurationException. |
| `moderation.default_rule` | unanimous | Default ApprovalRule for Reports::moderate() unless ->rule() is called: unanimous, quorum, any or weighted. An unknown value throws InvalidConfigurationException when Reports::moderate() is called. |
| `moderation.default_quorum` | null | Approval count (at least 1) of the quorum rule unless ->quorum() is called. null or blank (not set) requires every declared moderator; any other non-integer throws InvalidConfigurationException. |

The moderation block seeds the Reports::moderate() builder. An unrecognised default\_rule, or a default\_quorum that isn’t a whole number of at least 1, throws InvalidConfigurationException rather than falling back to the strictest setting.

## Environment

Only the two key types are env-backed:

```bash
REPORTS_KEY_TYPE=uuid
REPORTS_PRIMARY_KEY_TYPE=uuid
```

Values read from .env arrive as strings and are read as such: the integer keys accept integer strings ('5') and the switches accept 'true'/'false', '1'/'0', 'on'/'off' and 'yes'/'no' — anything else throws. A key that is not set — absent, null, or blank like a host’s KEY= — takes its default; for the optional threshold, prune\_after\_days and moderation.default\_quorum that means unset (no threshold, an explicit window required, every moderator), never 0. A value that is set but unusable throws the toolkit’s RoundlyConsulting\\PackageToolkit\\Exceptions\\InvalidConfigurationException rather than quietly picking a side, and php artisan about shows it as INVALID.

- A threshold, prune\_after\_days or moderation.default\_quorum that is not a whole number (“two”, “1.5”).
- A duplicate\_scope other than open or any, or an unknown moderation.default\_rule.
- A non-string table or default\_reason.
- A reasons list that is empty or holds a non-string slug.
- A model that is not Report or a subclass of it.

Set table, key\_type and primary\_key\_type before you migrate — all three are read when the migration runs. To check what is active, php artisan about includes a Reports section (see Artisan commands).

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