Hi!,
i am trying to implement draft functionality on model. in that while trying to swap two records. i am facing Expected MatanYadaev\EloquentSpatial\GeometryCast, string given this type of error.
Updating location data doesn't work.
Below is the snapshot of swapping code.
$oldAttributes = $published?->getAttributes() ?? [];
$newAttributes = $this->getAttributes();
Arr::forget($oldAttributes, $this->getKeyName());
Arr::forget($newAttributes, $this->getKeyName());
$published->forceFill($newAttributes);
$this->forceFill($oldAttributes);
The field is casted in model as
location' => Point::class,
in the migration the field is created as
$table->point('location')->nullable();
Using Laravel-Drafts package for implementing draft functionality.