fix(attendance): memperbaiki logika save image dan menampilkan image
This commit is contained in:
parent
0dea36d1cb
commit
4715a1dfce
@ -105,8 +105,7 @@ public function store(AttendanceRequest $request): JsonResponse
|
|||||||
'check_out' => now(),
|
'check_out' => now(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
$this->uploadAttachment($validatedData['image'], 'attendances', Attendance::class, $newAttendance->id, ! $checkInAttendance ? 'check_in' : 'check_out');
|
||||||
$this->uploadAttachment($validatedData['image'], 'attendances', Attendance::class, $newAttendance->id, 'attendance');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
@ -43,9 +43,9 @@
|
|||||||
@if ($checkInAttendance)
|
@if ($checkInAttendance)
|
||||||
<div class="flex-shrink-0">
|
<div class="flex-shrink-0">
|
||||||
<a
|
<a
|
||||||
href="{{ Storage::url("attendances/{$checkInAttendance->attachments->first()->formatted_attachment}") }}">
|
href="{{ Storage::url("attendances/{$checkInAttendance->attachments->where('type', 'check_in')->first()->formatted_attachment}") }}">
|
||||||
<img class="tab-img img-fluid"
|
<img class="tab-img img-fluid"
|
||||||
src="{{ Storage::url("attendances/{$checkInAttendance->attachments->first()->formatted_attachment}") }}"
|
src="{{ Storage::url("attendances/{$checkInAttendance->attachments->where('type', 'check_in')->first()->formatted_attachment}") }}"
|
||||||
alt="image">
|
alt="image">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -84,9 +84,9 @@
|
|||||||
@if ($checkOutAttendance)
|
@if ($checkOutAttendance)
|
||||||
<div class="flex-shrink-0">
|
<div class="flex-shrink-0">
|
||||||
<a
|
<a
|
||||||
href="{{ Storage::url("attendances/{$checkOutAttendance->attachments()->latest()->first()->formatted_attachment}") }}">
|
href="{{ Storage::url("attendances/{$checkOutAttendance->attachments()->where('type', 'check_out')->first()->formatted_attachment}") }}">
|
||||||
<img class="tab-img img-fluid"
|
<img class="tab-img img-fluid"
|
||||||
src="{{ Storage::url("attendances/{$checkOutAttendance->attachments()->latest()->first()->formatted_attachment}") }}"
|
src="{{ Storage::url("attendances/{$checkOutAttendance->attachments()->where('type', 'check_out')->first()->formatted_attachment}") }}"
|
||||||
alt="image">
|
alt="image">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user