the documentation says
"The belongsToMany relation will not use a pivot "table", but will push id's to a related_ids attribute instead. This makes the second parameter for the belongsToMany method useless. If you want to define custom keys for your relation, set it to null"
Then how can i set additional fields on related_ids attributes?
I have products and a cart,
here is a subdocument of cart about related_ids
product_id: [
'600ed36d5e2720122c633172',
'600ed3e792a0e87c86741eb2',
'600ed3f1bc85983ebc06fc53',
'600edcdfccfc896fe81fc262',
'600edd71bc665d23a03558c2'
],
but i need to set quantity for each product
question from:
https://stackoverflow.com/questions/65887379/laravel-jensseger-mongodb-belongstomany-additional-fields 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…