eloquent-filemaker icon indicating copy to clipboard operation
eloquent-filemaker copied to clipboard

Fix for multiple attribute mutator support

Open alexandrosraikos opened this issue 1 year ago • 0 comments
trafficstars

So far, I was able to make a custom model accessor value for multiple attributes using get following the official guide.

However, Mutating Multiple Attributes was breaking because the FMHasAttributes model override method assumed the custom $key was part of the attributes array. That's not always the case with multiple attribute accessors and mutators.

This is a proposed fix using Laravel's native hasAttributeSetMutator to check using reflection classes if this is a client-only attribute definition.

alexandrosraikos avatar Jul 11 '24 10:07 alexandrosraikos