F
Filament9mo ago
Abi

unable to get Standalone action working

I have this standalone action https://github.com/abishekrsrikaanth/filament-test/blob/main/app/Http/Livewire/StandaloneAction.php#L28 and I can't seem to get the modal form to load. Any advice would be great.
Solution:
yea
Jump to solution
14 Replies
awcodes
awcodes9mo ago
in your view it should be $this->addToCartAction
Abi
Abi9mo ago
@awcodes tried that already. din't work
awcodes
awcodes9mo ago
hmm. i'm not seeing anything obviously wrong with the action.
Abi
Abi9mo ago
its strange that the same code works on my other app, but not on this test app. I was trying to create an bug for another issue I was having and was setting up this repo and can't seem to get this to work
awcodes
awcodes9mo ago
you still need <x-filament-actions::modals /> in your livewire component view.
Abi
Abi9mo ago
the other actions/table components seem to load the modal. Do I still need that?
awcodes
awcodes9mo ago
yea, they are scoped to the LW component so in this case you have a LW component StandaloneAction, and the view for that still needs the modals for itself
Abi
Abi9mo ago
ok, trying that ok, that worked. thank you. can I confirm another bug that I am having before I raise this issue on github? I am passing a parameter to the action if you noticed on the view
Solution
awcodes
awcodes9mo ago
yea
Abi
Abi9mo ago
I am trying to access the $arguments in - https://github.com/abishekrsrikaanth/filament-test/blob/main/app/Http/Livewire/StandaloneAction.php#L29 - https://github.com/abishekrsrikaanth/filament-test/blob/main/app/Http/Livewire/StandaloneAction.php#L50 when the modal loads I am able to get the $arguments on L29, the form has a Select field with live() enabled. When the live event is triggered for the Select when I choose an item, the $arguments on L29 is empty
awcodes
awcodes9mo ago
that may be a bug
Abi
Abi9mo ago
ok
awcodes
awcodes9mo ago
I've think i've seen that mentioned before. Check the GitHub issues and see if it's mentioned there.
Abi
Abi9mo ago
ok the bugs on github seem to not be related, so just going to create one. thanks for the help