Infolist Action `->createAnother()` doesn't exist
We want to be able to reproduce the
->createAnother()
functionality which exists on a Filament\Actions\CreateAction
component but Infolists only accept instances of Filament\Infolists\Components\Actions\Action
which doesn't have the ->createAnother()
option.
I have thought about creating our own Action in our codebase, which extends the CreateAction
class (to inherit the ->createAnother()
function), but using this in an Infolist instance would also fail to satisfy the requirement for it to be an instance of Filament\Infolists\Components\Actions\Action
.
How can we go about doing this? 🤔Solution:Jump to solution
try this
```php
->action(function (array $data, Action $action, array $arguments, Form $form) {
...
7 Replies
Bumping this - any chance anybody can help? 🙏
Are you using a page or modal in your resource to create records?
Not sure I quite understand your question @Leandro Ferreira but I'll try and answer it...
I have a
ProjectResource
which uses the infolist()
method to control what is rendered to the /view
screen. That infolist is then broken down into multiple infolist Section
s which use headerActions()
. Example below:
Solution
try this
Thanks! I'll give this a go.
You legend, @Leandro Ferreira. This worked like a charm! 🙌 Thank you so much for your support. 🔥
While I've got you, @Leandro Ferreira, do you know why section
headerActions
can't be made to accept some of the default actions (such as CreateAction
) and only accept Filament\Infolists\Components\Actions\Action
instead?maybe Dan has plans to combine all Action classes into one, but not sure