Livewire multiple selection
#Laravel
#JavaScript
https://dev.to/koossaayy/laravel-livewire-multiple-selection-with-virtual-select-1f87
In order to pass the data to Livewire, we will use the JavaScript event listener, whenever the selection is changed, we will send them to our component.
So in our view file, what we need to add is the following code
let selectedPermissions = document.querySelector('#permissions');
selectedPermissions.addEventListener('change', () => {
let data = selectedPermissions.value;
@this.set('selectedPermissions', data);
});
HozzĂĄszĂłlĂĄsok
0 db