© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
gremki

Pivot cast in relation manager

Hello!
I have a
BelongsToMany
BelongsToMany
relationship with a pivot column and a coresponding
RelationManager
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,
    ];
}
class DataPivot extends MorphPivot
{
    protected $casts = [
        'data' => AsArrayObject::class,
    ];
}

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

Am I missing something here?
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Format Pivot fields in Relation Manager
FilamentFFilament / ❓┊help
2y ago
Reordable pivot table in Relation Manager
FilamentFFilament / ❓┊help
3y ago
Relation Manager for pivot table
FilamentFFilament / ❓┊help
2y ago
Interact with Pivot attributes in Relation Manager
FilamentFFilament / ❓┊help
17mo ago