Answer the question
In order to leave comments, you need to log in
How to display modal windows using laravel livewire using jetstream components?
Tell me about modal windows on livewire. I use jetstream and found out that there are windows of this type x-jet-confirmation-modal in the box, I learned how to display and hide it, but I just don’t know how to pass it, say, the id of the post that I want to delete, do not put the same code modal window in the body of the foreach where I display the posts. If there are normal docks or an example of how to use it?
Here is what is now:
<x-jet-confirmation-modal wire:model="confirmingUserDeletion">
<x-slot name="title">
Удалить аккаунт
</x-slot>
<x-slot name="content">
Вы уверены, что хотите удалить свою учетную запись? После удаления вашей учетной записи все ее ресурсы и данные будут удалены без возможности восстановления.
</x-slot>
<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingUserDeletion')" wire:loading.attr="disabled">
Отменить
</x-jet-secondary-button>
<x-jet-danger-button class="ml-2" wire:click="deleteUser" wire:loading.attr="disabled">
Удалить аккаунт
</x-jet-danger-button>
</x-slot>
</x-jet-confirmation-modal>
public function modal() {
$this->confirmingUserDeletion = true;
}
public function destroy($id) {
if ($id) {
$group = GroupCard::where('id', $id);
$group->delete();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question