© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
3 replies
Alexandre

Edit RelationManager pivot array data

Hi,

I'm trying to create a form to update my pivot table data for a resale system.

I have, in my Model Service, my relationship which includes the pivots:

    public function providers(): BelongsToMany
    {
        return $this->belongsToMany(Provider::class, 'provider_services')
            ->using(ProviderServicePivot::class)
            ->withPivot('extra', 'is_enabled')
            ->withTimestamps();
    }
    public function providers(): BelongsToMany
    {
        return $this->belongsToMany(Provider::class, 'provider_services')
            ->using(ProviderServicePivot::class)
            ->withPivot('extra', 'is_enabled')
            ->withTimestamps();
    }


And this is my ProviderServicePivot :

class ProviderServicePivot extends Pivot
{
    public function casts(): array
    {
        return [
            'extra' => 'array',
            'is_enabled' => 'boolean',
        ];
    }
}
class ProviderServicePivot extends Pivot
{
    public function casts(): array
    {
        return [
            'extra' => 'array',
            'is_enabled' => 'boolean',
        ];
    }
}


And on my form when i Try to access on extra.name property, it doesn't work.

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Section::make(__('inputs.sections.infos'))
                    ->columns(2)
                    ->schema([
                        Forms\Components\TextInput::make('extra.name')
                           ->label(__('inputs.generic.name'))
                           ->maxLength(255)
                           ->required()
                    ]),
            ]);
    }
    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Section::make(__('inputs.sections.infos'))
                    ->columns(2)
                    ->schema([
                        Forms\Components\TextInput::make('extra.name')
                           ->label(__('inputs.generic.name'))
                           ->maxLength(255)
                           ->required()
                    ]),
            ]);
    }


Anyone have an idea of ​​the method to follow?

Thank you so much,
Solution
I've found solution. I need to mount my EditAction with pivot to array
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Inserting pivot data without RelationManager
FilamentFFilament / ❓┊help
3y ago
Edit belongs to many pivot data from edit profile page
FilamentFFilament / ❓┊help
2y ago
Edit action on RelationManager with pivot redirects to linked Model instead (using pivot's ID)
FilamentFFilament / ❓┊help
6mo ago
Edit view from relationManager
FilamentFFilament / ❓┊help
2y ago