Skip to content
New issue

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

Table aliases in hasManyDeepFromRelation #22

Closed
hoggerty opened this issue Feb 21, 2019 · 4 comments
Closed

Table aliases in hasManyDeepFromRelation #22

hoggerty opened this issue Feb 21, 2019 · 4 comments

Comments

@hoggerty
Copy link

I have 2 hasManyDeep relations, where i use table aliases and both work great. But if i try to create new relation from this two via hasManyDeepFromRelation, table aliases disappear from query and i get an error: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias.

Is it possible to add table aliases to hasManyDeepFromRelation?

@staudenmeir
Copy link
Owner

hasManyDeepFromRelations() is only meant for Laravel's "default" relationships, it doesn't support HasManyDeep relationships at the moment (with or without alias).

Can you create the combined relationship by concatenating/merging the arguments of the two HasManyDeep relationships?

@hoggerty
Copy link
Author

Yes thank you. I already did as you wrote.

Do you planned to realize that feature at the future?

@staudenmeir
Copy link
Owner

I'll take a look at it.

@staudenmeir
Copy link
Owner

The latest release supports hasManyDeepFromRelations() with HasManyDeep relationships.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants