Event created on Pivot Model #49173
Replies: 1 comment
-
well, i guess i have to change the relationship instead of using many to many |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have problem in using Event created on pivot model, i want each time the record created the field of 'order_detail_no' is filled based on it's id. But the $orderProduct is returning all the pivot record.

I can use $orderProduct->latest()->first(), but is it good to code like this?
description:
Order table and relation many to many to Product table (intermediate table i named order_details)
In order table i have field 'order_no' and it is based on database record id.

for Order Model it is working
and there the attach code

Beta Was this translation helpful? Give feedback.
All reactions