-
I found out when calling For example, let's say we have a model called Foo and a model called Bar, with Foo having many Bar's. Bar is soft deletable. We have one Foo row and two Bar rows in the database, both Bar rows related to Foo. Bar 1 is soft deleted (deleted_at not null), Bar 2 is not soft deleted (deleted_at null). When we run select * from `foo` where `bar`.`foo_id` = ? and `bar`.`foo_id` is not null and `bar`.`deleted_at` is null The query shows the soft deletes scope being active. When we then call Why is this the case, and more importantly, why can't I find this in the documentation anywhere? Did I miss something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
$barsToDelete = $foo->bar()->whereNotNull('deleted_at');
$barsToDelete->forceDelete(); |
Beta Was this translation helpful? Give feedback.
Unfortunately it is not in docs and I had this experience myself too.
In most cases in different languages, I see
force
and they don't care about the details, so because of this they warn to use this word. LikeforceFill
that ignore all conditions in the model.