Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:8.xfrom
rodrigopedra:8.x
Feb 11, 2022
Merged

[8.x] Fix isRelation() failing to check an Attribute#40967
taylorotwell merged 1 commit into
laravel:8.xfrom
rodrigopedra:8.x

Conversation

@rodrigopedra
Copy link
Copy Markdown
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