Skip to content

Commit 1a00178

Browse files
committed
fix: appointment approved
1 parent bec166b commit 1a00178

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

app/Http/Controllers/Backend/UserAppointmentController.php

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public function approve(int $id)
131131
}
132132
}
133133
$appointment->is_approved = true;
134+
$appointment->approved_at = now();
134135
$appointment->update();
135136
Calendar::create([
136137
'title' => 'Appointment Scheduled',

resources/views/backend/user/appointmentsApproved.blade.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ class="badge bg-success p-2">{{ $appointment->expertProfile?->post }}</span>
8181
<td>
8282
@if ($appointment->is_completed)
8383
<span class="badge bg-soft-success text-success p-1 fs-6">Completed</span>
84-
@else
84+
@elseif($appointment->approved_at)
8585
<span class="badge bg-soft-success text-success p-1 fs-5">Approved At:
8686
{{ $appointment->approved_at?->format('d F, Y') }}</span>
87+
@else
88+
<span>No approved date</span>
8789
@endif
8890
</td>
8991
@if($appointment->map_id)

resources/views/backend/user/appointmentsCompleted.blade.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,26 @@
7474
<span class="badge bg-warning p-1 fs-6">Yet to complete</span>
7575
@endif
7676
</td>
77-
@isset($appointment->map_id)
77+
@if($appointment->map_id)
7878
<td>
79+
@if ($appointment->map)
7980
<strong>Location: {{ $appointment->map->location }}</strong>
8081
<strong class="d-block">Address:</strong>
8182
<p class="text-muted">
8283
{{ $appointment->map->address }}
8384
</p>
85+
@else
86+
No branch selected
87+
@endif
88+
8489
</td>
8590
@else
8691
<td>
8792
<span class="badge bg-info p-1 fs-6">
8893
Virtual
8994
</span>
9095
</td>
91-
@endisset
96+
@endif
9297
<td>
9398
<span class="fw-bold">
9499
{{ $appointment->created_at->format('d F, Y') }}

0 commit comments

Comments
 (0)