F
Filament2mo 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
Tally2mo ago
This should be possible with just plain Filament actions
Abes07
Abes072mo 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
More Posts
Hide create button in a form with wizardHi everyone! I'm using a Wizard in a form when creating a resource. My submit button is at the lastSpecifying navigation items order within navigation groupsHow do I specify the navigation items order withing navigation groups? I can order the navigation gUncaught Snapshot missing on Livewire component with id: QAcNIGM0wsdXZxTaZYW7Hello, I have a widget on the dashboard panel and I run into this error: ```livewire.js?id=07f2287Livewire Component Not WorkingHello, I add a livewire component consisting on a select of options. When the select changes, nothinFileupload on registration page - 419 errorFor full context, we have a Filament app with 2 panels - Admin & Member. When a member registers, anCan't login into panel when user model use uuidHello i'm using uuid's on mi user model, I have configured all what is necessary to use it but I caAuthorize Imports: Apply different policy methods on create and updateI am using `authorize` method for Importer to show it only to the users that have `create` authorizaReplicate action: load form instead of saveI was searching for a way to add ***Clone*** table action, and came across ***Replicate*** action. TFilament Shield allows create/edit/delete despite role restrictions. Shouldn't have these permissionThe Filament plugin shield still allows users to create, edit, and delete even though I have not givCheck for user profile completeHi! My user model has some extra fields that I would like to be completed. My UserPanel is like this