-
Notifications
You must be signed in to change notification settings - Fork 404
Description
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Framework | Laravel |
| Framework version | 10.10 |
| Package version | 13.6 |
| PHP version | 8.1 |
Actual Behaviour
I have field in DB storing spatial data, and more specifically point type in MySQL. When I create model or edit this field, it is not stored on audits table (when update only this field, new_values and old_values is empty array). When try to delete model, i get exception: Unable to encode attribute [old_values] for model [OwenIt\Auditing\Models\Audit] to JSON: Malformed UTF-8 characters, possibly incorrectly encoded. in ./vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php
Expected Behaviour
Somehow, store spatial data change.
Steps to Reproduce
- Create table with column with type
Point. - Create model for this table
- Do basic setup of auditing for this model.
- Try to edit
pointfield, you will get empty arrays. - Try to delete row, you get exception
If this is expected behavior, can you point me to some idea how to fix this in my application? Unfortunately i cannot skip this field with $auditExclude, i need this data history. I can split the point field into two decimal fields lat and long, but if there is any solution, I would like to be able to use the point type