Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix saving version of model with JSON field
When a model uses `$casts = ['field' => 'array']` with a JSON field, getAttributes() will return the JSON-encoded string, while $model->fill() expects the input to contain the un-encoded JSON value. So instead, use attributesToArray() to get the model data, which will work properly with fill(). Fixes #43
- Loading branch information