Hello!
What would be the right way to set the relationship?
Can't figure out :(
I have this table structure:
Owners
- id
Cars
- id
- owner_id
Keys
- id
- keyable_type
- keyable_id
I already have this relationships set and working:
Owner > hasOne > Car
Car > morphOne > Key
Key > morphTo > Car
Car > belongsTo > Owner
(Owner > hasOne > Car > morphOne > Key)
(Key > morphTo > Car > belongsTo > Owner)
What should I use to get this relationship?
Owner > ??? > Key
And inverse:
Key > ??? > Owner
Hello! What would be the right way to set the relationship? Can't figure out :(
I have this table structure:
I already have this relationships set and working: Owner >
hasOne
> Car Car >morphOne
> Key Key >morphTo
> Car Car >belongsTo
> Owner (Owner >hasOne
> Car >morphOne
> Key) (Key >morphTo
> Car >belongsTo
> Owner)What should I use to get this relationship? Owner >
???
> Key And inverse: Key >???
> OwnerWill highly appreciate your help 🙏