Difference of using Trait DocumentModel and extending using Mongodb Model #3106
-
Just want to clarify if there are some drawbacks of using one to the other thanks |
Beta Was this translation helpful? Give feedback.
Answered by
GromNaN
Aug 21, 2024
Replies: 1 comment 1 reply
-
Using
The trait |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
masterbater
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
MongoDB\Laravel\Eloquent\Model
should be preferred:Model::isDocumentModel
function.$primaryKey
and$keyType
The trait
MongoDB\Laravel\Eloquent\DocumentModel
was introduced in order to support 3rd party model classes.