F
Filament14mo 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
awcodes14mo ago
in your view it should be $this->addToCartAction
Abi
AbiOP14mo ago
@awcodes tried that already. din't work
awcodes
awcodes14mo ago
hmm. i'm not seeing anything obviously wrong with the action.
Abi
AbiOP14mo 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
awcodes14mo ago
you still need <x-filament-actions::modals /> in your livewire component view.
Abi
AbiOP14mo ago
the other actions/table components seem to load the modal. Do I still need that?
awcodes
awcodes14mo 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
AbiOP14mo 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
awcodes14mo ago
yea
Abi
AbiOP14mo 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
awcodes14mo ago
that may be a bug
Abi
AbiOP14mo ago
ok
awcodes
awcodes14mo ago
I've think i've seen that mentioned before. Check the GitHub issues and see if it's mentioned there.
Abi
AbiOP14mo ago
ok the bugs on github seem to not be related, so just going to create one. thanks for the help
Want results from more Discord servers?
Add your server