When a cast attribute is cached (either because the accessor returns an object or because shouldCache() is used), there is no way from outside the model to invalidate the cache.
This pull request expands the existing offsetUnset() method to unset the cached value when calling $model->unset($attribute).
When a cast attribute is cached (either because the accessor returns an object or because
shouldCache()
is used), there is no way from outside the model to invalidate the cache.This pull request expands the existing offsetUnset() method to unset the cached value when calling
$model->unset($attribute)
.