Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,6 @@ To delete a model, you may call the `delete` method on the model instance:

$flight->delete();

You may call the `truncate` method to delete all of the model's associated database records. The `truncate` operation will also reset any auto-incrementing IDs on the model's associated table:

Flight::truncate();

<a name="deleting-an-existing-model-by-its-primary-key"></a>
#### Deleting an Existing Model by its Primary Key

Expand Down
9 changes: 0 additions & 9 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -1165,15 +1165,6 @@ The query builder's `delete` method may be used to delete records from the table

$deleted = DB::table('users')->where('votes', '>', 100)->delete();

If you wish to truncate an entire table, which will remove all records from the table and reset the auto-incrementing ID to zero, you may use the `truncate` method:

DB::table('users')->truncate();

<a name="table-truncation-and-postgresql"></a>
#### Table Truncation and PostgreSQL

When truncating a PostgreSQL database, the `CASCADE` behavior will be applied. This means that all foreign key related records in other tables will be deleted as well.

<a name="pessimistic-locking"></a>
## Pessimistic Locking

Expand Down