-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[6.x] Add 'setRawAttribute' method #30853
[6.x] Add 'setRawAttribute' method #30853
Conversation
@taylorotwell I believe this creates a clash: If there is an attribute named 'raw', and the developer wanted to set its value with a mutator using $model->raw = 'value', that mutator method would be named setRawAttribute(...), with a different signature to this new one. |
This reverts commit 503e9c3.
I don't see why this was needed anyway. If someone wants to bypass the framework to set the actual value, they can... the attributes are a public property. |
We've reverted this. See #30884 |
I know, that's what lead to my comment, to help anyone who wants this feature. :) |
@GrahamCampbell think we cross-posted at the same time |
@GrahamCampbell the attributes is a protected property. |
Heh, well, it can still be set from within the model. |
Oh you mean ‘public’ in that way 😄 I added the ‘setRawAttribute’ because I wanted to set an attribute without created dedicated method in my model |
Nah, I meant it in the real way, but was wrong. :P |
But the premise is the same. |
Currently it's not possible to skip a mutator of one specific attribute.
The
setRawAttributes
method exists, but that requires you to provide values for all attributes.I did not add any tests, because I could not find one for
setRawAttributes
. Let me know if I should add one.