Skip to content

Mutator doesnt work with arrays, only string #3298

Closed Answered by masterbater
masterbater asked this question in Q&A

You must be logged in to vote

Thanks for digging the source code 🙏

Its also in the docs which I have reviewed if this behavior is documented and its there, set array ignores the method to be used as field or column and can set multiple attribute

Each key in the array should correspond with an underlying attribute / database column associated with the model:

https://laravel.com/docs/12.x/eloquent-mutators#mutating-multiple-attributes

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@masterbater

Answer selected by GromNaN
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants