Launch one table action from the createAction
Hi,
Can anyone help point me in the right direction of launching a table action from the completion of a CreateAction.
Dependent on the outocome of the entry, and the specifics of the data entered, I would like it to write the row, and then launch straight into a table action for that row.
Thanks
Solution:Jump to solution
maybe
```php
Actions\CreateAction::make()
->after(function (YourModel $record) {...
10 Replies
bump
Anyone ?
Still struggling with this.....
could you explain a bit more? kinda hard to understand your 1st explanation. thank you..
Not sure exactly what you are trying to do, but maybe this will help: https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component#chaining-actions
I suppose it could be simplified to this:
If I've got a CreateAction, that makes a new row...how can I immediately launch a TableAction on that new row ?
bump
Solution
maybe
Nope.
Unfortunately not working. A dd of the command returns null.
Any other suggestions very gratefully received.
This doesn't feel like an edge case use ?
you mean,
dd($record)
returns null?Ahh....actually it does work.
But, I was using a form filler that as well as filling the slideover form also populates the searhc box in the table behind.
So, when it was being called, the newly created record was already filtered out, and thus didn't fire.
In the real world, people won't be using form fillers, but it could be the case they will have filtered the table for something else, beofre they then decide to create new one....
Can I clear the filter and search as part of the Create Action ?
resetTable
didn't seem to work, but I tried some other methods, and decided on a kitchen sink approach, with a notification to blame the user's browser.
So that is working to an acceptable level.
Many thanks for your help. I was almost resigned to a lot of form duplication and intricate wizards !