We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I'm having following models and table name:
Tags: table name (project_tags)
Tags
project_tags
id name
which is related to TechnicalDescription model with many to many relationship:
TechnicalDescription
many to many
TechnicalDescription: table name(project_technical_detail)
project_technical_detail
id project_id description
Many to many relation holds on table (technical_detail_tag_relation):
Many to many
technical_detail_tag_relation
id technical_detail_id tag_id
And finally I have Project Model table name(projects)
Project
projects
So I have Tags -> belongsToMany -> TechnicalDescription -> belongsTo -> Project
belongsToMany
belongsTo
I tried doing:
public function projects() { return $this->hasManyDeep( Project::class, ['technical_detail_tag_relation', TechnicalDescription::class], [null, null, 'id'], [null, null, 'project_id'] ); }
But it throws error:
Column not found: 1054 Unknown column 'technical_detail_tag_relation.technical_description_id' in 'on clause'
Can you help me out with it, I tried replacing technical_description_id almost every null place where I defined this relationship, but no luck.
technical_description_id
null
I'm trying to learn about your package, but little confused with this kind of relationships.
Thanks.
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
You are missing the project_id column:
project_id
public function projects() { return $this->hasManyDeep( Project::class, ['technical_detail_tag_relation', TechnicalDescription::class], ['tag_id', 'id', 'id'], ['id', 'technical_detail_id', 'project_id'] ); }
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: