© 2026 Hedgehog Software, LLC

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

How to prefill data after "createAnother" action?

Hey, just wanna maintain some inputs prefilled when I hit the "createAnother" button. I'm trying some Action methods but can't get it :/

protected function getCreateAnotherFormAction(): Action
    {
        return Action::make('createAnother')
            ->label(__('createAnother'))
            ->dispatchSuccessRedirect()
            ->beforeFormFilled(function () {
                $this->data['employee_id'] = request('employee_id');
                $this->data['project_id'] = request('project_id');
                $this->data['date'] = request('date');
                $this->data['imputation_type'] = request('imputation_type');
            })
            ->action('createAnother')
            ->keyBindings(['mod+shift+s'])
            ->color('secondary');
    }
protected function getCreateAnotherFormAction(): Action
    {
        return Action::make('createAnother')
            ->label(__('createAnother'))
            ->dispatchSuccessRedirect()
            ->beforeFormFilled(function () {
                $this->data['employee_id'] = request('employee_id');
                $this->data['project_id'] = request('project_id');
                $this->data['date'] = request('date');
                $this->data['imputation_type'] = request('imputation_type');
            })
            ->action('createAnother')
            ->keyBindings(['mod+shift+s'])
            ->color('secondary');
    }
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

createAnother in custom action
FilamentFFilament / ❓┊help
15mo ago
CreateAnother Retain Some Data
FilamentFFilament / ❓┊help
2y ago
Displaying prefill data in action form select with relationship
FilamentFFilament / ❓┊help
16mo ago
Infolist Action `->createAnother()` doesn't exist
FilamentFFilament / ❓┊help
2y ago