© 2026 Hedgehog Software, LLC

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

Is it possible to get form from resource and add it to createOptionForm?

As the title says, I don't like having to repeat the content of the form in a section and in any other select field that has a createOptionForm method on it.

I guess I can just put it on a helper function in a service class or something but I was wondering if it would be possible to do it in a nicer way.
Solution
So we do it like this within the activity plugin:

$form = static::getResource()::form(new Form($this));

You could also put a static array return function within the resource file and call that single function each time 🙂
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

Get state from form to createOptionForm
FilamentFFilament / ❓┊help
16mo ago
createOptionForm - how to import form schema, is it possible?
FilamentFFilament / ❓┊help
3y ago
Get Schema from Form for createOptionForm()I
FilamentFFilament / ❓┊help
12mo ago
Reuse a Form Resource in createOptionForm
FilamentFFilament / ❓┊help
3y ago