© 2026 Hedgehog Software, LLC

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

Custom table action for related resources

I have missions and goals components. In the missions component, I created a "Create Goal" table action which renders a modal to add a goal for that mission. When I click submit, it wants to add the record to the missions table, not the goals table. Here's my action code. How do I get it to save to the goals table, also, how do I pass the mission_id to this action?

    protected function getTableActions(): array
    {
        return [
            CreateAction::make('Create Goal')
                ->form(function (Goal $goal) use ($user) {
                    $form = Form::make('createGoal', [
                        'model' => $goal,
                    ]);
                    $form->schema([
                        Hidden::make('mission_id')
                            ->default(mission_id value???)
....
    protected function getTableActions(): array
    {
        return [
            CreateAction::make('Create Goal')
                ->form(function (Goal $goal) use ($user) {
                    $form = Form::make('createGoal', [
                        'model' => $goal,
                    ]);
                    $form->schema([
                        Hidden::make('mission_id')
                            ->default(mission_id value???)
....
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 Table Action
FilamentFFilament / ❓┊help
3y ago
Custom Header Action In Resources
FilamentFFilament / ❓┊help
3y ago
Custom table row action
FilamentFFilament / ❓┊help
3y ago
Custom Action in Table
FilamentFFilament / ❓┊help
3y ago