#How to set tags to a TagsInput using $set
10 messages · Page 1 of 1 (latest)
in the create form, you can use ->default(['a', 'b'])
as you can see in tthe image , i added an action on the right , i am setting the tags from that action
try this
TagsInput::make('tags')
->suffixAction(Action::make('add')
->icon('heroicon-o-user-plus')
->form([
TextInput::make('name')
])
->action(function (array $data, Page $livewire) {
$livewire->data['tags'][] = $data['name'];
}))
Failed
Property [$data] not found on component: [app.filament.admin.resources.meeting-resource.pages.manage-meetings]
$livewire->mountedActionData ?
$livewire->mountedActionsData['tags'][] = $data['employee_id'];
does not throw an error but tags are not set , the input has no value
Share the whole code on gist please
Hey, sorry for the delay
->action(function (array $data, Page $livewire) {
$tags = $livewire->mountedActionsData[0]['tags'];
$tags = array_merge($tags, $data['employee_id']);
})