Releases: carsdotcom/laravel-json-model
v1.2.2
If an attribute mutator on a JsonModel throws an exception, that exception will also be caught and the change reverted during safeUpdateRecursive
. This lets us support attribute mutators that try to clean up values but will ultimately throw an exception if the data can't possibly be massaged.
v1.2.1
When HasJsonModelAttributes hydrates a JsonModel, the model is already isDirty() === false
which is correct. Fixes a bug when HasJsonModelAttributes hydrates a CollectionOfJsonModels all the models should also be isDirty() === false
and improves test coverage.
v1.2.0
Updates safeUpdateRecursive
to catch any exception and anything that causes saving
handler to return false. The method now returns an array of all the exceptions it caught.
Deprecates safeUpdate
-- given that it's designed to work with semi-trusted inputs, it's always safer to recurse into child objects rather than risk overwriting them.