#Nested relationships.

3 messages · Page 1 of 1 (latest)

chilly burrow
#

Hi guys! I have a a big issue with nested relationship while i try to create a new model.

I have a Person, BaseData and Address model.

The relationships:

a Person has a BaseData and the BaseData has an Address.

I tried to solve like this in my Person class:

public function baseData() : belongsTo
{
return $this->belongTo(BaseData::class)->with('address');
}

But this kind of approach only work if i edit the Person and not in creation process.

Do you have any idea? I tried to google this issue, but i couldn't find any answer.

oak siloBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution