F
Filament15mo ago
Abi

Utility Injection on action method not working

does utility injection work on Action's action method? when I try Action::icon('some-icon')->action(function (Livewire $livewire, $state) { I get the following error
Argument #1 ($livewire) must be of type Livewire\Livewire, Edit{Resource}Page given
called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
Argument #1 ($livewire) must be of type Livewire\Livewire, Edit{Resource}Page given
called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
Solution:
Should be ‘Component’ not ‘Livewire’. You’re using the wrong class.
Jump to solution
6 Replies
Solution
awcodes
awcodes15mo ago
Should be ‘Component’ not ‘Livewire’. You’re using the wrong class.
Abi
AbiOP15mo ago
i was trying to access the Livewire instance i see the import on that example, thank you
awcodes
awcodes15mo ago
You are doing it right you’re just injecting the wrong class. 🙂
Abi
AbiOP15mo ago
thank you. Would you mind if I DM you? Got to get some opinion on something I have been working on.
awcodes
awcodes15mo ago
Sure. Fair warning my brain doesn’t want to work today. Lol.
Want results from more Discord servers?
Add your server