© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
Ackerman

Make Form Component Utility Injection Can be Called from Custom Method

I got custom form field with several custom methods in it, i want to access utility injections ($get, $set, etc.) on my custom methods.

i tried

MyCustomForm::make('name')
->myCustomMethod(fn(callable $get) => $get('other_name'))
MyCustomForm::make('name')
->myCustomMethod(fn(callable $get) => $get('other_name'))


but got error that paramater $get is not passed.
Solution
Also you need to call
$this->evaluate()
$this->evaluate()
to evaluate your closure. Have a look at the Filament source code to see how it works.
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

Utility Injection on action method not working
FilamentFFilament / ❓┊help
3y ago
Custom form component with methods
FilamentFFilament / ❓┊help
3y ago
Form component injection in macros
FilamentFFilament / ❓┊help
3y ago
Custom form component
FilamentFFilament / ❓┊help
16mo ago