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') -