feat(attendance): menambahkan kolom pegawai di kehadiran

This commit is contained in:
Yoga Pangestu 2024-12-15 19:59:46 +07:00
parent 86df663400
commit 4d62f32561
3 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class AttendanceController extends Controller
public function index(Request $request): View|JsonResponse
{
if ($request->ajax()) {
$attendances = Attendance::with('attachments')
$attendances = Attendance::with(['user', 'user.biography', 'attachments'])
->barbershop()
->when(in_array(auth()->user()->role_id, [4, 5]), function ($query) {
return $query->where('user_id', auth()->id());

View File

@ -4,6 +4,9 @@ window.columns = [
orderable: false,
searchable: false
},
{
data: 'user.biography.full_name'
},
{ data: 'created_at' },
{ data: 'check_in' },
{ data: 'check_in_image' },

View File

@ -120,6 +120,7 @@
<thead>
<tr>
<th>No</th>
<th>Pegawai</th>
<th>Tanggal</th>
<th>Masuk</th>
<th>Foto</th>