Jan 17, 2018
0
Level 6
Relationship with() using date field not id?
I have a bonus_periods table with a start_date and end_date columns. I have an incidents table with an incident_date column. I’d like to create bonus_periods has many incidents and vice versa where incidents.incident_date is between bonus_periods.start_date and bonus_periods.end_date.
I know how to do it with join and I can do it with nested foreach but can it be defined so I can use with()?
Please or to participate in this conversation.