F
Filament7mo ago
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)" 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
3 Replies
Solution
Tally
Tally7mo ago
This should be possible with just plain Filament actions
Abes07
Abes07OP7mo ago
Thanks, i've looked at the documentation multiple times but i didn't see that part, this is exactly what i needed!
Want results from more Discord servers?
Add your server