Skip to content

Commit

Permalink
More features.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGhostHunter committed Jan 22, 2024
1 parent a6ef841 commit 6d1c909
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions docs/model-properties/factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Factories for Models are created automatically for [Quick Models](../model.md#qu
When creating models, the `HasFactory` trait will be automatically included in the model and documented via its PHPDoc.

::: tip Soft Deletes comes free
If you're using [soft-deletes](../model-columns/soft-deletes.md#deleted-factory-state), the `trashed` state will be created for free.
Laravel includes the `trashed` state when your model uses [soft-deletes](../model-columns/soft-deletes.md#deleted-factory-state).
:::

```yaml
Expand Down Expand Up @@ -59,13 +59,6 @@ class PostFactory extends Factory
// // ...
// ];
}

public function trashed()
{
return $this->state([
$this->newModel()->getDeletedAtColumn() => now(),
]);
}
}
```

Expand Down

0 comments on commit 6d1c909

Please sign in to comment.