Skip to content

Commit

Permalink
Document Model::truncate() (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin authored Nov 27, 2024
1 parent 4e2fb9a commit 77d2b42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions database/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ You may also run a delete query on a set of models. In this example, we will del
$deletedRows = Flight::where('active', 0)->delete();
```

Deleting all records of a model:

```php
Flight::truncate();
```

> **NOTE**: It is important to mention that [model events](model#events) will not fire when deleting records directly from a query.
## Query scopes
Expand Down

0 comments on commit 77d2b42

Please sign in to comment.