rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.78k stars 335 forks source link

Modals for actions (create, edit, delete) #97

Closed marioene closed 3 years ago

marioene commented 3 years ago

Hi! First, great package!

I want to implement Bootstrap 4 modal on different actions (edit or delete) in my TableComponent, but I am stuck right now.

  1. How can I call an edit form in a modal with values from every row? Can I use wire:model in my modal form?

  2. Where can I validate and save the values resulted from the update action from the form?

  3. It is possible to show me a small example?

rappasoft commented 3 years ago

You can make each button its own livewire component and pass the current ID of the model from the row? Or pass the model itself to prepopulate whatever is in your modal.