I deleted some record(with SoftDeletes), But it won't disapear...? #38762
-
Sorry for my english. I want to know when i deleted some record (with SoftDeletes).
and this:
my database is:
people:
building_owners
I deleted it at building_owners's model.
and
as it as a function in building's model
I want to know why these 2 methods are different or. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Do you soft delete the records in your pivot table (building_owners)? If so, as far as I know soft deletes doesn't work in pivot tables. You will have to update your relationship and explicitly exclude entries with a value in the https://laravel.com/docs/8.x/eloquent-relationships#filtering-queries-via-intermediate-table-columns |
Beta Was this translation helpful? Give feedback.
Do you soft delete the records in your pivot table (building_owners)? If so, as far as I know soft deletes doesn't work in pivot tables. You will have to update your relationship and explicitly exclude entries with a value in the
deleted_at
column (->wherePivotNull('deleted_at')
)https://laravel.com/docs/8.x/eloquent-relationships#filtering-queries-via-intermediate-table-columns