© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
core

EditAction on relationsmanager updating wrong table

I have an IngredientsRelationManager on. RecipeResource.
the AttachAction And Detach work fine updating the recipe_ingredient table .for some reason in the EditAction the following code updates the ingredients table name field with the ingredients.id,
$ingredients = Cache::remember('ingredients_list', 60, function () {
            return Ingredient::all()->pluck('name', 'id')->toArray();
        });
//
->actions([
                // ...
                Tables\Actions\EditAction::make()
                    ->form([
                        Forms\Components\Select::make('name')
                            ->searchable()
                            ->options($ingredients),
                        Forms\Components\TextInput::make('quantity')->required(),
                        Select::make('unit')
                            ->label('Unit')
                            ->options(Unit::query()->pluck('unit', 'symbol'))
                            ->required(),
                    ]),
                Tables\Actions\DetachAction::make()
                    ->modalHeading('Remove Ingredient')
                    ->modalIcon('heroicon-o-trash')
                    ->label('Remove'),

            ])
$ingredients = Cache::remember('ingredients_list', 60, function () {
            return Ingredient::all()->pluck('name', 'id')->toArray();
        });
//
->actions([
                // ...
                Tables\Actions\EditAction::make()
                    ->form([
                        Forms\Components\Select::make('name')
                            ->searchable()
                            ->options($ingredients),
                        Forms\Components\TextInput::make('quantity')->required(),
                        Select::make('unit')
                            ->label('Unit')
                            ->options(Unit::query()->pluck('unit', 'symbol'))
                            ->required(),
                    ]),
                Tables\Actions\DetachAction::make()
                    ->modalHeading('Remove Ingredient')
                    ->modalIcon('heroicon-o-trash')
                    ->label('Remove'),

            ])
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

RelationsManager Table View/Edit actions
FilamentFFilament / ❓┊help
3y ago
Why my RelationsManager table doesnt show actions?
FilamentFFilament / ❓┊help
16mo ago
EditAction and ViewAction doesn't work on livewire-table
FilamentFFilament / ❓┊help
3y ago
Defining record in Table EditAction not working
FilamentFFilament / ❓┊help
2y ago