Closed nathanheffley closed 1 year ago
Hey friends! The team at Tighten has taken Parental back over and we're re-opening the issue tracker, but to give us a clean slate, I'm going to close all old issues that remain from when Caleb closed the issue tracker in 2020. If this is still an outstanding concern with the latest version of Parental, please feel free to open a new issue referencing this one.
Thank you!
I noticed that if a model is totally guarded (it has no
fillable
properties and the guarded array is equal to['*']
thengetChildModel()
in theHasChildren
trait will throw a Mass Assignment Exception when doing actions likeParentModel::first()
.You can get around this by setting your
fillable
array to literally anything (I currently have mine as such:protected $fillable = ['not_totally_guarded'];
) and everything will work fine from what I can tell.Not a huge inconvenience for models that you want to be totally guarded, but it would be nice if the package could do something differently to bypass this unnecessary exception.