© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
29 replies
Shaung Bhone

Can't save form action

I can't save the value in advanced form action that give me null.
Forms\Components\TextInput::make('remaining_stock')
->disabled()
->suffixAction(
    Action::make('addingNewStock')
        ->label('Add New Stock')
        ->icon('heroicon-m-plus')
        ->requiresConfirmation()
        ->form([
            Forms\Components\TextInput::make('adding_stock')
                ->numeric()
                ->rules(['integer', 'min:0'])
        ])
        ->modalIcon('heroicon-m-plus')
        ->action(function (
            Forms\Set $set, Get $get, array $data
        ): void {
            $set(
                'remaining_stock',
                $get('remaining_stock') + $data['adding_stock']);
        })
)
Forms\Components\TextInput::make('remaining_stock')
->disabled()
->suffixAction(
    Action::make('addingNewStock')
        ->label('Add New Stock')
        ->icon('heroicon-m-plus')
        ->requiresConfirmation()
        ->form([
            Forms\Components\TextInput::make('adding_stock')
                ->numeric()
                ->rules(['integer', 'min:0'])
        ])
        ->modalIcon('heroicon-m-plus')
        ->action(function (
            Forms\Set $set, Get $get, array $data
        ): void {
            $set(
                'remaining_stock',
                $get('remaining_stock') + $data['adding_stock']);
        })
)
Solution
sorry, it confused me. You were showing the edit page with the problem, now you are saying that it is working 🤷‍♂️
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

Save form before running action
FilamentFFilament / ❓┊help
3y ago
Save form from a header action
FilamentFFilament / ❓┊help
16mo ago
EditForm - can't submit form action on set on form header actions
FilamentFFilament / ❓┊help
3y ago
Replicate action: load form instead of save
FilamentFFilament / ❓┊help
2y ago