Veur
Veur
FFilament
Created by Veur on 6/5/2024 in #❓┊help
Testing Repeater component
@Leandro Ferreira thanks 😅
4 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
Ok, thanks!
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
Is that a bug or expected behavior?
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
@Leandro Ferreira one thing I forgot to mention is that the Select field is a multiple select ->multiple() And when I remove that, the options are being refreshed using Livewire's $refresh event. Any idea why it's not working with ->multiple()? The solution with dispatchFormEvent() still won't work btw.
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
@Leandro Ferreira yes this is basically what I'm doing, only my form is in another component. Maybe that's the reason it's not working?
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
The modal is a separate (non-Filament) Livewire component
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
In the modal component, after saving the options and before closing the modal
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
Select::make('select')
->options($field->selectOptions())
->registerListeners([
'updateOptions' => [
function (Select $component) use ($field): void {
dd($component);
$component->options($field->selectOptions());
},
],
])
Select::make('select')
->options($field->selectOptions())
->registerListeners([
'updateOptions' => [
function (Select $component) use ($field): void {
dd($component);
$component->options($field->selectOptions());
},
],
])
And from the modal where the options are managed: $this->dispatchFormEvent('updateOptions'); I also implemented HasForms and added use InteractsWithForms; to the modal.
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
I'm also trying to find documentation about this feature, but it's not documented
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
@Leandro Ferreira thanks, but it doesn't work. I added a dd() to the listener callback but nothing happens
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
Ok, below is a simplified example:
protected function form(Form $form): Form
{
return $form->schema($fieldsFromDb->map(fn (FormField $field) => Select::make($field->name)->options($field-getOptions()))
->flatten()
->toArray()
);
}
protected function form(Form $form): Form
{
return $form->schema($fieldsFromDb->map(fn (FormField $field) => Select::make($field->name)->options($field-getOptions()))
->flatten()
->toArray()
);
}
$fieldsFromDb is a Collection with fields from the database. getOptions() is a method in the FormField model that returns the options for that specific field. This all works fine, but I don't know how to refresh the list of options.
24 replies
FFilament
Created by Veur on 4/8/2024 in #❓┊help
Update Select options after event
@Leandro Ferreira yeah, but my form has a lot of Select fields with own options. The options can be edited inside a modal. So, I'm dispatching an event from the modal to the form, but I don't know how to 'refresh' the select component. I tried $this->dispatch('$refresh'); from the modal, but no luck
24 replies
FFilament
Created by Veur on 1/10/2024 in #❓┊help
CreateOptionForm is not showing
That was it, thanks @Leandro Ferreira! 🙂 I thought that wasn't needed anymore in V3
5 replies
FFilament
Created by Veur on 12/12/2023 in #❓┊help
Custom theme: Unable to locate file in Vite manifest
Thanks!
11 replies
FFilament
Created by Veur on 12/12/2023 in #❓┊help
Custom theme: Unable to locate file in Vite manifest
Ah, of course 🙂
11 replies
FFilament
Created by Veur on 12/11/2023 in #❓┊help
Add an Action to a Form label or hint
@Lara Zeus hero! Thanks!
14 replies
FFilament
Created by Veur on 12/11/2023 in #❓┊help
Add an Action to a Form label or hint
This is what I tried @Lara Zeus
TextInput::make('name')
->extraAttributes([
'class' => 'group',
])
->hintAction(
Action::make('copy')
->icon('heroicon-m-cog')
->extraAttributes([
'class' => 'hidden group-hover:block',
])
->action(function (Set $set, $state) {
$set('name', $state);
})
);
TextInput::make('name')
->extraAttributes([
'class' => 'group',
])
->hintAction(
Action::make('copy')
->icon('heroicon-m-cog')
->extraAttributes([
'class' => 'hidden group-hover:block',
])
->action(function (Set $set, $state) {
$set('name', $state);
})
);
14 replies
FFilament
Created by Veur on 12/11/2023 in #❓┊help
Add an Action to a Form label or hint
@Lara Zeus thanks, I tried that using styling based on parent state (.group) and with sibling state (.peer) but none of that works, as the extra attribute is added to the input element wrapper, and the hint is not a child or sibling. Do you have any idea?
14 replies
FFilament
Created by Veur on 12/11/2023 in #❓┊help
Add an Action to a Form label or hint
No not trigger, showing. So hide it initially and show when hovering over the field
14 replies