© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
9 replies
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) {
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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Action - utility injection (Get, Set)
FilamentFFilament / ❓┊help
6mo ago
action method not working on a standalone Action
FilamentFFilament / ❓┊help
3y ago
Action authorize() method not working
FilamentFFilament / ❓┊help
6mo ago
Make Form Component Utility Injection Can be Called from Custom Method
FilamentFFilament / ❓┊help
3y ago