Closed nitish1986 closed 5 years ago
I tried fixing this:
public function projects()
{
return $this->hasManyDeep(
Project::class,
['technical_detail_tag_relation', TechnicalDescription::class],
['tag_id', 'id', 'id'],
['id', 'technical_detail_id', 'id']
);
}
I think it is working. Just need confirmation about it. Thanks.
You are missing the project_id
column:
public function projects()
{
return $this->hasManyDeep(
Project::class,
['technical_detail_tag_relation', TechnicalDescription::class],
['tag_id', 'id', 'id'],
['id', 'technical_detail_id', 'project_id']
);
}
Hello,
I'm having following models and table name:
Tags
: table name (project_tags
)which is related to
TechnicalDescription
model withmany to many
relationship:TechnicalDescription
: table name(project_technical_detail
)Many to many
relation holds on table (technical_detail_tag_relation
):And finally I have
Project
Model table name(projects
)So I have
Tags
->belongsToMany
->TechnicalDescription
->belongsTo
->Project
I tried doing:
But it throws error:
Can you help me out with it, I tried replacing
technical_description_id
almost everynull
place where I defined this relationship, but no luck.I'm trying to learn about your package, but little confused with this kind of relationships.
Thanks.