delete HasCompositePrimaryKey
Closed this issue · 3 comments
isbkch commented
Hi,
I see the methods setKeysForSaveQuery() and find() in the trait, but I was wondering how the delete() would work ? No risk of deleting everything
mopo922 commented
You can look at the source of Illuminate\Database\Eloquent\Model
to see that Model::delete()
calls Model::performDeleteOnModel()
which calls - tada! - Model::setKeysForSaveQuery()
.
isbkch commented
I should've checked. beautiful
mopo922 commented
Np. Laravel is such a well-written framework. It makes it easy to override one method like this to adapt it to your needs.