Dynamic Repeater
I'm using the Google Maps API with drawing tools to create shapes like polygons, rectangles, and markers. Could you please guide me on how to automatically fill in the coordinates within a Repeater, with new entries being added dynamically each time I draw something on the map? Ex I'm specifically looking for information on how to implement the "Add to invitation" functionality.
3 Replies
Or how can I add the field without clicking the button? Is there a trigger like on click?
You can use stateUpdate;
TextInput::make('name')
->live()
->afterStateUpdated(function (?string $state, ?string $old) {
// ...
})
or you can use hidden and visible condition on live input, for example;
Checkbox::make('is_company')
->live()
TextInput::make('company_name') ->visible(fn (Get $get): bool => $get('is_company')) (when checked is_company, company_name field goes to visible)
TextInput::make('company_name') ->visible(fn (Get $get): bool => $get('is_company')) (when checked is_company, company_name field goes to visible)
But still you want to trigger button click, you need spesific livewire component on custom page. After create livewire component, you can use all livewire features;
https://livewire.laravel.com/docs/actions (wire:keyup maybe for input update)
Laravel
Actions | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.