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

[8.x] Fix isRelation() failing to check an Attribute #40967

Merged
merged 1 commit into from
Feb 11, 2022
Merged

[8.x] Fix isRelation() failing to check an Attribute #40967

merged 1 commit into from
Feb 11, 2022

Conversation

rodrigopedra
Copy link
Contributor

If an Eloquent model has a attribute defined using the new Attribute class, Model@isRelation(...) returns true when checking for the attribute name,

This PR:

  • Adds a if clause at Model@isRelation(...) to check if a attribute is defined with the same name
  • Adds a test that would fail prior to the changes proposed

Note: I am sending this to 8.x as it seems to be a bugfix from the related issue's description.

Closes #40966

@taylorotwell taylorotwell merged commit 5a8585a into laravel:8.x Feb 11, 2022
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

Successfully merging this pull request may close these issues.

2 participants