v0.11.1d - Fixed WashingReservation

This commit is contained in:
Anders 2020-09-02 13:15:11 +02:00
parent 2f5a03343a
commit 821428c150
2 changed files with 3 additions and 2 deletions

View File

@ -132,6 +132,7 @@ class WashingReservationController extends Controller
public function destroy($id)
{
$machineReservation = WashingReservation::find($id);
dd($id);
$machineReservation->delete();
$reservations = WashingReservation::query()->paginate( 20);
@ -265,7 +266,7 @@ class WashingReservationController extends Controller
{
WashingReservation::query()->where('time', '<', date('Y-m-d H:i:s', strtotime('-1 hour')))->delete();
$reservations = WashingReservation::query()->join('washing_machines', 'washing_machines.id', '=', 'washing_reservations.machine_id')->join('locations', 'locations.id', '=', 'washing_machines.location_id')->where("user_id", "=", auth()->user()->id)->orderBY('time' , 'asc')->paginate($request->query("limit", 20));
$reservations = WashingReservation::query()->where("user_id", "=", auth()->user()->id)->orderBY('time' , 'asc')->paginate($request->query("limit", 20));
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
}

View File

@ -16,7 +16,7 @@
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
<div class="row align-items-center">
<span style="font-size: 4vw; white-space: pre-line;"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}
- {{ $reservation->name }}</span>
- {{ \App\Location::query()->where('id', '=', \App\WashingMachine::query()->find($reservation->machine_id)->location_id)->first()->name }}</span>
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
@csrf
@method("delete")