Hamidullo Rahmonberdiyev
Hamidullo Rahmonberdiyev
FFilament
Created by magarrent on 5/29/2023 in #❓┊help
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 :/ class CreateQuestion extends CreateRecord { protected static string $resource = QuestionResource::class; public function getTitle(): string|Htmlable { return __('models/question.action.create'); } protected function getHeaderActions(): array { return [ $this->getCreateFormAction() ->submit(null) ->action('create'), $this->getCreateAnotherFormAction() ->submit(null) ->action(fn () => $this->createAnother()), $this->getCancelFormAction() ->submit(null) ->action('cancel'), ]; } protected function getFormActions(): array { return []; } public function createAnother(): void { session()->flash('dataFill', [ 'purpose' => $this->data['purpose'], 'books' => $this->data['books'], ]); parent::createAnother(); }
11 replies