© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
17 replies
Jakub

Table Header Actions: How to access data?

I have a RelationManager table, and I am trying to add a quick payment action on it which would create a new PaymentRecord

->headerActions([
    Tables\Actions\Action::make('quick-payment')->label('Quick Payment')
        ->action(function (PhoneMembership $record, array $data) {
            dd($data);
        })
        ->color('success'),
    Tables\Actions\CreateAction::make()->label('Add Manual Transaction')->slideOver()->modalWidth('lg'),
])
->headerActions([
    Tables\Actions\Action::make('quick-payment')->label('Quick Payment')
        ->action(function (PhoneMembership $record, array $data) {
            dd($data);
        })
        ->color('success'),
    Tables\Actions\CreateAction::make()->label('Add Manual Transaction')->slideOver()->modalWidth('lg'),
])


Trying to figure out how to access PhoneMembership info

$record->phoneMembershipRecords()->create([
    'date' => now(),
    'type' => EType::CREDIT,
    'value' => $data['value'],
    'memo' => 'Quick payment',
]);
$record->phoneMembershipRecords()->create([
    'date' => now(),
    'type' => EType::CREDIT,
    'value' => $data['value'],
    'memo' => 'Quick payment',
]);
e3628eee856949b5f37a525c135441f4.png
Solution
                Tables\Actions\Action::make('quick-payment')->label('Quick Payment')
                    ->action(function () {
                        $this->ownerRecord->phoneMembershipRecords()->create([
                            'date' => now(),
                            'type' => EType::CREDIT,
                            'value' => $this->ownerRecord->billing_cycle * $this->ownerRecord->monthly_rate,
                            'memo' => 'Quick Payment',
                        ]);
                    })
                Tables\Actions\Action::make('quick-payment')->label('Quick Payment')
                    ->action(function () {
                        $this->ownerRecord->phoneMembershipRecords()->create([
                            'date' => now(),
                            'type' => EType::CREDIT,
                            'value' => $this->ownerRecord->billing_cycle * $this->ownerRecord->monthly_rate,
                            'memo' => 'Quick Payment',
                        ]);
                    })
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

Add table filter to header actions
FilamentFFilament / ❓┊help
2mo ago
Actions in a table group header
FilamentFFilament / ❓┊help
10mo ago
How to place form actions on header actions
FilamentFFilament / ❓┊help
3y ago
How to access $data from relation manager in actions([])
FilamentFFilament / ❓┊help
3y ago