---
title: "The Report model — Reports for Laravel | Roundly"
description: "Report attributes, relations, scopes and soft deletes — and how to swap in your own Report subclass."
url: https://roundly-consulting.com/open-source/docs/reports-for-laravel/report-model
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)

# The Report model

Each report is a Report model with status cast to the Status enum and resolved\_at cast to a datetime:

```php
$report->status;            // Status enum
$report->reason;            // 'spam' — the reason slug
$report->description;       // ?string — the reporter's description
$report->guest_identifier;  // ?string — set for guest reports
$report->resolution_note;   // ?string — the moderator's note
$report->resolved_at;       // ?Carbon
```

## Relations

Three MorphTo relations point at the models involved:

```php
$report->reporter;    // ?Model — null for guest and anonymous reports
$report->reported;    // ?Model — the reported subject
$report->resolvedBy;  // ?Model — the moderator who settled it
```

## Soft deletes

Report uses soft deletes: delete() keeps the row and timestamps deleted\_at. Use withTrashed(), restore() and forceDelete() as usual:

```php
$report->delete();                  // keeps the row, sets deleted_at
Report::withTrashed()->find($id);
$report->restore();
$report->forceDelete();             // removes the row for good
```

## Using your own model

Point model at a subclass of Report to add behaviour — Report is deliberately not final:

```php
namespace App\Models;

use RoundlyConsulting\Reports\Models\Report as BaseReport;

class Report extends BaseReport
{
    // your own relations, scopes and casts
}

// config/reports.php
'model' => App\Models\Report::class,
```

The traits, actions, commands and Report::factory() all resolve the model through config, so your subclass is what they create and query — seeded reports run its casts and events too. A configured class that isn’t Report or a subclass of it throws the toolkit’s InvalidConfigurationException naming the key — it is never silently replaced by the packaged Report.

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