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

249
Views
How can I save multiple relations 1:N in cascade on Laravel?

How can I save multiple relations 1:N in cascade on Laravel?

E.g this is a brief of my database:

bills
 -id
 -name

items
  -id
  -name
  -bill_id

item_members
  -id
  -user_id
  -item_id

For saving all items of a bill you can do: $bill->items()->saveMany($items). But how can I save all the item_members of item in cascade? like: $bill->items()->saveMany($items)->saveMany($item_members)?

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!