delete bitcoin event

This commit is contained in:
HolgerHatGarKeineNode
2023-02-26 18:03:44 +01:00
parent 2e5a723910
commit 03fcb375bf
3 changed files with 21 additions and 6 deletions

View File

@@ -62,6 +62,13 @@ class BitcoinEventForm extends Component
} }
} }
public function deleteMe()
{
$this->bitcoinEvent->delete();
return redirect($this->fromUrl);
}
public function submit() public function submit()
{ {
$this->validate(); $this->validate();

View File

@@ -8,14 +8,22 @@
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Bitcoin Event') }}</h3> <h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('Bitcoin Event') }}</h3>
<div class="flex flex-row space-x-2 items-center"> <div class="flex flex-row space-x-2 items-center">
@can('delete', $bitcoinEvent) @can('delete', $bitcoinEvent)
<div>
@if($bitcoinEvent->id) @if($bitcoinEvent->id)
<x-button negative wire:click="deleteMe"> <div x-data>
<x-button
x-on:click="$wireui.confirmDialog({
icon: 'warning',
title: '{{ __('Are you sure you want to delete this Bitcoin event?') }}',
accept: {label: '{{ __('Yes') }}',
execute: () => $wire.deleteMe()},
reject: {label: '{{ __('No, cancel') }}'},
})"
negative>
<i class="fa fa-thin fa-trash"></i> <i class="fa fa-thin fa-trash"></i>
{{ __('Delete') }} {{ __('Delete') }}
</x-button> </x-button>
@endif
</div> </div>
@endif
@endcan @endcan
<div> <div>
<x-button :href="$fromUrl"> <x-button :href="$fromUrl">