© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
bwurtz999

Custom action in relation manager

Hello - is it possible to pass a parameter in a custom action in a relation manager table?

public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('item.name'),
                Tables\Columns\TextColumn::make('qty')
                    ->label('Quantity'),
            ])
            ->filters([
                //
            ])
            ->headerActions([
                // Tables\Actions\CreateAction::make(),
            ])
            ->actions([
                // Tables\Actions\EditAction::make(),
                // Tables\Actions\DeleteAction::make(),
                Tables\Actions\Action::make('refundItem')
                    ->label('Refund Item')
                    ->action(function($record) {
                        return "refundItem($record->id)";
                    })
            ])
            ->bulkActions([
                // Tables\Actions\DeleteBulkAction::make(),
            ]);
    }

    public function refundItem($selectionId)
    {
        dd($selectionId);
    }
public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('item.name'),
                Tables\Columns\TextColumn::make('qty')
                    ->label('Quantity'),
            ])
            ->filters([
                //
            ])
            ->headerActions([
                // Tables\Actions\CreateAction::make(),
            ])
            ->actions([
                // Tables\Actions\EditAction::make(),
                // Tables\Actions\DeleteAction::make(),
                Tables\Actions\Action::make('refundItem')
                    ->label('Refund Item')
                    ->action(function($record) {
                        return "refundItem($record->id)";
                    })
            ])
            ->bulkActions([
                // Tables\Actions\DeleteBulkAction::make(),
            ]);
    }

    public function refundItem($selectionId)
    {
        dd($selectionId);
    }


I can use a custom action without a parameter. When I add the record ID as a parameter I see two requests but neither one seems to work
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

Custom Action from Relation Manager
FilamentFFilament / ❓┊help
2y ago
Relation manager in action/modal
FilamentFFilament / ❓┊help
3y ago
Relation manager in custom page
FilamentFFilament / ❓┊help
3y ago
Relation manager custom action + Spatie media library plugin
FilamentFFilament / ❓┊help
2y ago