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

HasManyDeep::one() Doesn't Seem To Work As Expected #249

Closed
MannikJ opened this issue Oct 10, 2024 · 4 comments
Closed

HasManyDeep::one() Doesn't Seem To Work As Expected #249

MannikJ opened this issue Oct 10, 2024 · 4 comments

Comments

@MannikJ
Copy link

MannikJ commented Oct 10, 2024

I encountered errors when trying to convert a HasManyDeep relation to a HasOneX relation although the HasManyDeep relation itself works. The "one"-relation uses wrong column names etc.

In fact the first thing I noticed was that HasManyDeep::one() will return a HasOneThrough relation instead of HasOneDeep as I would expecet. The reason for this is that HasManyDeep does not (yet) overwrite the implementation of the one() function from its parent class HasManyThrough.

Maybe this feature was just overseen or not yet implemented.

@staudenmeir
Copy link
Owner

Hi @MannikJ,
The one() method is much, much newer than the package. I'll look into it.

@staudenmeir
Copy link
Owner

I released a new version with support for HasManyDeep::one().

"Funnily" enough, HasManyThrough::one() doesn't work either (laravel/framework#53119). It looks like nobody has tried to use it so far...

@MannikJ
Copy link
Author

MannikJ commented Oct 11, 2024

"Funnily" enough, HasManyThrough::one() doesn't work either (laravel/framework#53119). It looks like nobody has tried to use it so far...

😅
We have often wondered whether we are the only ones using something. I'm not sure whether this is good or bad...

Thank you for addressing this so quickly!

@staudenmeir
Copy link
Owner

I'm not sure whether this is good or bad...

Yeah...

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