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

"SELF" relationships within same table not properly resolved #297

Open
KONEY opened this issue Sep 24, 2024 · 0 comments
Open

"SELF" relationships within same table not properly resolved #297

KONEY opened this issue Sep 24, 2024 · 0 comments

Comments

@KONEY
Copy link

KONEY commented Sep 24, 2024

Hi, great pagacke!

I have found however a possible bug with foreign keys pointing at the same table.

I've got a simple self-parenthood where primary id points to a parent_id on the same table, the resolved relationships looks like this:

public function questions() { return $this->hasMany(Questions::class, 'parent_id'); }

while there should be also/or a "belongsTo" relationship.

I tried also by specifing a second relationships where parent_id and id are inverted with no results.

Changing relation_name_strategy from 'related' to 'foreign_key' works like it should but every other relationship name become different, disrupting the application.

Is there any know workaround or suggesion?

Thanks!

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

1 participant