diff --git a/app/Http/Controllers/BookingsController.php b/app/Http/Controllers/BookingsController.php index e445c41..c39cbe9 100644 --- a/app/Http/Controllers/BookingsController.php +++ b/app/Http/Controllers/BookingsController.php @@ -213,7 +213,9 @@ class BookingsController extends Controller */ public function delete(Booking $booking) { - // + $booking->load('subBookings.accountType.accountClass.ioType'); + + return view('/bookings/delete', compact('booking')); } /** @@ -224,7 +226,9 @@ class BookingsController extends Controller */ public function destroy(Booking $booking) { - // + $booking->delete(); + + return redirect('/bookings/year-' . Carbon::parse(request('date'))->format('Y')); } /** diff --git a/resources/views/bookings/delete.blade.php b/resources/views/bookings/delete.blade.php new file mode 100644 index 0000000..73e50b3 --- /dev/null +++ b/resources/views/bookings/delete.blade.php @@ -0,0 +1,43 @@ +@extends('layout.master') + +@section('title', 'Buchung löschen') + +@section('subnav') + Zurück +@endsection + +@section('content') +
| ID | Datum | @@ -28,6 +29,7 @@ @if (date('Y') > $year or (date('Y') == $year and date('m') >= $month))|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ startOfMonth($year, $month) }} | @@ -47,6 +49,9 @@ v @endif ++ x + | {{ $booking->id }} @@ -82,6 +87,7 @@ | + | + | {{ $subBooking->reference }} | @@ -110,6 +116,7 @@ @if (date('Y') > $year or (date('Y') == $year and date('m') >= $month)) | ||||||
| @@ -136,7 +143,7 @@ | ||||||||||||
| @endfor |