diff --git a/app/Http/Controllers/HistoryController.php b/app/Http/Controllers/HistoryController.php index 11b2455..a4b17b5 100644 --- a/app/Http/Controllers/HistoryController.php +++ b/app/Http/Controllers/HistoryController.php @@ -13,6 +13,7 @@ public function history() $now = Carbon::now(); $upcomingHistories = LabsBooking::with('lab', 'user') + ->where('user_id', auth()->user()->id) ->where(function ($query) use ($now) { $query->where('booking_date', '>=', $now->format('Y-m-d')) ->orWhere(function ($subquery) use ($now) { diff --git a/app/Http/Controllers/LabBookingController.php b/app/Http/Controllers/LabBookingController.php index b17390f..1a91741 100644 --- a/app/Http/Controllers/LabBookingController.php +++ b/app/Http/Controllers/LabBookingController.php @@ -97,6 +97,6 @@ public function update(Request $request, LabsBooking $labsBooking) public function destroy(LabsBooking $labsBooking) { $labsBooking->delete(); - return redirect('/')->with('success', 'Booking berhasil dihapus'); + return back()->with('success', 'Booking berhasil dihapus'); } } diff --git a/app/Livewire/LabSchedule.php b/app/Livewire/LabSchedule.php index f4904a0..8c0b1be 100644 --- a/app/Livewire/LabSchedule.php +++ b/app/Livewire/LabSchedule.php @@ -89,6 +89,7 @@ public function render() 'timeMapping' => TimeMappings::$timeMappings, 'classSchedule' => ClassSchedule::where('lab_id', $this->lab->id)->get(), 'labsBooking' => $filteredData, + 'title' => $this->lab->name, ]); } diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php index 0150239..8822ee9 100644 --- a/resources/views/components/layouts/app.blade.php +++ b/resources/views/components/layouts/app.blade.php @@ -11,7 +11,7 @@ @stack('style') - {{ $title ?? 'Page Title' }} + Dashboard | {{ config('app.name') }}
diff --git a/resources/views/dashboard/reschedule/index.blade.php b/resources/views/dashboard/reschedule/index.blade.php index 61688a5..8f74e7d 100644 --- a/resources/views/dashboard/reschedule/index.blade.php +++ b/resources/views/dashboard/reschedule/index.blade.php @@ -40,7 +40,7 @@ {{ $booking->end_time }} Reschadule -
+ @csrf @method('delete') diff --git a/resources/views/home/history.blade.php b/resources/views/home/history.blade.php index 82a75b5..993e230 100644 --- a/resources/views/home/history.blade.php +++ b/resources/views/home/history.blade.php @@ -1,44 +1,120 @@ @extends('layouts.index') @section('container') -

Histori Booking Ruangan

-
-

Mendatang

+
+
+ +

Mendatang

@foreach ($upcomingHistories as $history) -
+
{{ $history->reason_to_booking }}
{{ \Carbon\Carbon::parse($history->booking_date)->format('d F Y') }} +
({{ \Carbon\Carbon::parse($history->booking_date)->diffForHumans()}})

{{ $history->start_time }} - {{ $history->end_time }}

- - + +
+ @csrf + @method('delete') +
+
@endforeach -
+ -

Selesai

-
+

Selesai

@foreach ($expiredHistories as $history) -
+
{{ $history->reason_to_booking }}
@@ -54,6 +130,4 @@ class="inline-block rounded bg-red-500 px-6 pb-2 pt-2.5 text-xs font-medium lead @endforeach - - @endsection \ No newline at end of file diff --git a/resources/views/lab/index.blade.php b/resources/views/lab/index.blade.php deleted file mode 100644 index d0cc040..0000000 --- a/resources/views/lab/index.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -@extends('layouts.index') - -@section('container') -
- -@push('scripts') - - - - - - - -@endpush -@endsection \ No newline at end of file diff --git a/resources/views/layouts/dashboard.blade.php b/resources/views/layouts/dashboard.blade.php index f293d7d..50f07fb 100644 --- a/resources/views/layouts/dashboard.blade.php +++ b/resources/views/layouts/dashboard.blade.php @@ -6,7 +6,7 @@ - Sidebars ยท Bootstrap v5.3 + Dashboard | {{ config('app.name') }} diff --git a/resources/views/layouts/index.blade.php b/resources/views/layouts/index.blade.php index 98f853c..dbeb3ad 100644 --- a/resources/views/layouts/index.blade.php +++ b/resources/views/layouts/index.blade.php @@ -3,7 +3,7 @@ - SIMARU + {{ $title ?? config('app.name') }} diff --git a/routes/web.php b/routes/web.php index 7764dec..7d9db89 100644 --- a/routes/web.php +++ b/routes/web.php @@ -41,6 +41,7 @@ Route::middleware('auth')->group(function () { Route::post('/', [LabBookingController::class, 'store'])->name('booking'); Route::get('accept/{request_reschedule}', [RescheduleController::class, 'acceptReschedule']); + Route::delete('labs-booking/{labs_booking}', [LabBookingController::class, 'destroy'])->name('labs-booking.destroy'); }); @@ -63,7 +64,6 @@ Route::get('reschedule/', [RescheduleController::class, 'index'])->name('reschedule.index'); Route::get('reschedule/{labs_booking}', [RescheduleController::class, 'create'])->name('reschedule.create'); Route::post('reschedule/{labs_booking}', [RescheduleController::class, 'store'])->name('reschedule.store'); - Route::delete('labs-booking/{labs_booking}', [LabBookingController::class, 'destroy'])->name('labs.destroy'); Route::get('report', Report::class)->name('report'); });