Replies: 1 comment
-
I haven't used that data type, protected $casts = [
'your_point_field' => YourPointCustomCaster::class,
]; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 onaudits
table (when update only this field,new_values
andold_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
Point
.point
field, you will get empty arrays.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 thepoint
field into two decimal fieldslat
andlong
, but if there is any solution, I would like to be able to use thepoint
typeBeta Was this translation helpful? Give feedback.
All reactions