Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
Laravel Jensseger Mongodb belongsToMany additional fields

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

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!