victorybiz / laravel-tel-input

Laravel Telephone Input component for Blade and Livewire based on the intl-tel-input JavaScript plugin.
https://github.com/victorybiz/laravel-tel-input
MIT License
39 stars 12 forks source link

Cannot bind Livewire to Model #23

Open MCKLtech opened 1 year ago

MCKLtech commented 1 year ago

We're using the following code to bind to a $state array:

<x-tel-input
wire:model.defer="state.{{$key}}"
wire:key="{{$key}}"
class="form-input"
/>

However, the phone number is never saved and is empty in the array. We've tried to use defer, lazy etc.

I'm not sure if would make a difference, but we have two fields, a phone and a phone confirmation.

hsmfawaz commented 2 months ago

checkout this comment https://github.com/victorybiz/laravel-tel-input/issues/16#issuecomment-2081259345