© 2026 Hedgehog Software, LLC

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

How to create a form to Edit record instead of Create in RelationManager excluding AssociateAction

I have a relation manager in my userResource and I tried AssociateAction and it works however I need to be able to customize so I thought of creating a custom Action but when I create a form schema for it. But when I simply save it, it just creates a new record. I want to instead update the equipment field foreign id for user_id to what user edit record page I am currently at.

I also want it to be multiple() so I don't have to do it one by one

                Tables\Actions\AssociateAction::make(),
                Tables\Actions\Action::make('Borrow')
                    ->form([
                        Forms\Components\Select::make('barcode')
                            ->searchable()
                            ->multiple()
                            ///where('barcode') is what is searched and pluck('name') is what appears
                            ->getSearchResultsUsing(fn (string $search): array => Equipment::where('barcode', 'like', "%{$search}%")->limit(50)->pluck('name')->toArray())
                    ]),
                Tables\Actions\AssociateAction::make(),
                Tables\Actions\Action::make('Borrow')
                    ->form([
                        Forms\Components\Select::make('barcode')
                            ->searchable()
                            ->multiple()
                            ///where('barcode') is what is searched and pluck('name') is what appears
                            ->getSearchResultsUsing(fn (string $search): array => Equipment::where('barcode', 'like', "%{$search}%")->limit(50)->pluck('name')->toArray())
                    ]),
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

How to get the form data in a RelationManager create or edit action?
FilamentFFilament / ❓┊help
10mo ago
how to use RelationManager inside the create and edit form of the Resource
FilamentFFilament / ❓┊help
3y ago
How to make create/edit a modal instead of a page?
FilamentFFilament / ❓┊help
12mo ago