diff --git a/database/relations.md b/database/relations.md index c07281c6..6e1890dd 100644 --- a/database/relations.md +++ b/database/relations.md @@ -52,7 +52,7 @@ Argument | Description `scope` | filters the relation using a supplied scope method. `push` | if set to false, this relation will not be saved via `push`, default: true. `delete` | if set to true, the related model will be deleted if the primary model is deleted or relationship is destroyed, default: false. -`detach` | if set to false the related model will not be automatically detached if the primary model is deleted or the relationship is destroyed. Used by `belongsToMany` relationships only, default: true. +`detach` | if set to false the related model will not be automatically detached if the primary model is deleted or the relationship is destroyed. Used by `belongsToMany`, `morphToMany` and `morphedByMany` relationships only, default: true. `count` | if set to true, the result contains a `count` column only, used for counting relations, default: false. Example filter using **order** and **conditions**: diff --git a/database/traits.md b/database/traits.md index e5083f23..32f8fb70 100644 --- a/database/traits.md +++ b/database/traits.md @@ -622,6 +622,7 @@ class User extends Model } ``` +> **NOTE:** If the soft deleting relation is using a pivot table, you can set the `deletedAtColumn` option on the relation definition to change the column that will hold the soft deletion date in the pivot table, otherwise, it defaults to `deleted_at`. > **NOTE:** If the related model does not use the soft delete trait, it will be treated the same as the `delete` option and deleted permanently. Under these same conditions, when the primary model is restored, all the related models that use the `softDelete` option will also be restored.