[Discusion/Proposal] MassAssignableException only thrown on first non mass assignable property, not on subsequent ones, behaviour proposal #38982
Unanswered
PrinsFrank
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
When filling the property $fillable for a model and mass assigning values not in that array, those get quietly ignored, where mass assigning for the first time trows an exception. This is counter intuitive, because when mass assigning a new property I would expect an exception warning me that that property is not fillable instead of quietly continueing.
Steps To Reproduce:
Cause
In
Illuminate/Database/Eloquent/Model.php
in the 'fill' method, this behaviour is explicitely described:Proposal
This behaviour is counter intuitive. Is there a possibility to discuss changing this to always throw a massAssignableException when passing properties that are not set in the $fillable property? This would be a change for a major version, but I suspect there are lot more people that have bugs caused by this than there are people relying on the security feature aspect of this behavior.
Beta Was this translation helpful? Give feedback.
All reactions