Pivot cast in relation manager

Hello!
I have a BelongsToMany relationship with a pivot column and a coresponding RelationManager to attach/edit this relation. The create/save operation work fine but, on edit, the form is no longer filled with pivot data.

The pivot is defined like this:
class DataPivot extends MorphPivot
{
    protected $casts = [
        'data' => AsArrayObject::class,
    ];
}

The only thing I could notice is that, if a do dd($data) in mutateRecordDataUsing, the pivot_data is string and not casted to array.

Am I missing something here?
image.png
Was this page helpful?