© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
toeknee

Pivot not saving to db?

Thoughts on what might cause a select pivot not to save to the db? But manually entering to the DB loads it perfectly.

                                Forms\Components\Select::make('owningCompanies')
                                    ->label('Owning Company')
                                    ->relationship('owningCompanies', 'name')
                                    ->options(fn() => Company::select('name', 'id')->where('type', 'OWNING')->get()->pluck('name', 'id'))
                                    ->preload()
                                    ->multiple()
                                    ->maxItems(1)
                                    ->columnSpan(3),
                                Forms\Components\Select::make('owningCompanies')
                                    ->label('Owning Company')
                                    ->relationship('owningCompanies', 'name')
                                    ->options(fn() => Company::select('name', 'id')->where('type', 'OWNING')->get()->pluck('name', 'id'))
                                    ->preload()
                                    ->multiple()
                                    ->maxItems(1)
                                    ->columnSpan(3),


    public function owningCompanies(): \Illuminate\Database\Eloquent\Relations\belongsToMany
    {
        return $this->belongsToMany(Company::class)->where('type', 'OWNING');
    }
    
    public function owningCompanies(): \Illuminate\Database\Eloquent\Relations\belongsToMany
    {
        return $this->belongsToMany(Company::class)->where('type', 'OWNING');
    }
    
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

Repeater not saving pivot relationship
FilamentFFilament / ❓┊help
2y ago
Fileupload not saving to DB
FilamentFFilament / ❓┊help
3y ago
problem saving pivot table
FilamentFFilament / ❓┊help
3y ago
Pre-populating form and saving to pivot
FilamentFFilament / ❓┊help
2y ago