© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
jackcbet

Dependency Injection on Custom Fields

Hello,

I have a custom field that I've created which has a few getter/setter functions - one of which is called mergeTags().

When calling this function from my form ie:

CustomFieldName::make('custom_field)
->mergeTags(....)

I would like to dependancy inject the record I am currently editing, the same way you can do with default etc:

->default(function (Model $record) {
return $record->....;
}),

Any ideas how this can be accomplished?

Currently I get 'Too few arguments to function...' error
Thanks!
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

Dependency injection.
FilamentFFilament / ❓┊help
3y ago
Dependency Injection in Filament
FilamentFFilament / ❓┊help
2y ago
Dependency injection for CreateRecord page
FilamentFFilament / ❓┊help
2y ago
Livewire Methods on custom fields
FilamentFFilament / ❓┊help
2y ago