Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work on mutated attributes? You should probably be using attributesToArray() instead of the attributes property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure on this.. because this method only checks if this key (i.e., the field) is set.. The value is not needed for this method..
As far as i know, mutators should only work on
attributes
(e.g., apply additional functions on the values in order to change formatting or whatever). Therefore,$this->attributes
should be enough for the scope of this function..Or am I missing something really critical?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite true, although mutators should have a relationship with attributes someone could create a totally independent mutator.
But what I meant in the first place is, no mater if the attribute is a mutator or not this should return true, if not it could lead to confusion as I do not need to know if the attribute was a mutator in the first place or a real attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i changed it to
attributesToArray()
- thank you for pointing that out..