© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Abes07

Fill form data from from Controller

I have this custom field that behaves just like a normal TextInput, but i've place a button near it that wen pressed send an event with the current value of the field to its controller. The controller then makes an API request to a server and gets some data back that must me inserted in the other field of the form.
The question I have is, is there any wayt to set this data without making another custom field?

This is how I send the event:

wire:click="dispatchFormEvent('Component::eventName', $state)"
wire:click="dispatchFormEvent('Component::eventName', $state)"


And this is how I register that event in the controller:

protected function setUp(): void
    {
        $this->registerListeners([
            'Component::eventName' => [
                function ($component, $customValue) {
                   //Send API request with $customValue
                },
            ],
        ]);
    }
protected function setUp(): void
    {
        $this->registerListeners([
            'Component::eventName' => [
                function ($component, $customValue) {
                   //Send API request with $customValue
                },
            ],
        ]);
    }
Solution
This should be possible with just plain Filament actions
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

Fill Form Data
FilamentFFilament / ❓┊help
3y ago
mutate form data before fill
FilamentFFilament / ❓┊help
3y ago
Catch data from fill
FilamentFFilament / ❓┊help
3y ago
Fill form from within resource
FilamentFFilament / ❓┊help
3y ago