style: Standardize spacing and formatting in Manage Attendances page for improved code readability.

This commit is contained in:
Yoga Pangestu 2026-03-12 13:45:41 +07:00
parent 0e8c40ef1b
commit f7efd30b2a

View File

@ -89,7 +89,7 @@ public function getScheduleCards()
'id' => $schedule->id,
'course_name' => $schedule->course->name,
'lecturer_name' => $schedule->course->lecturer?->full_name ?? 'Belum Ditentukan',
'time_range' => $schedule->start_time->format('H:i') . ' - ' . $schedule->end_time->format('H:i'),
'time_range' => $schedule->start_time->format('H:i').' - '.$schedule->end_time->format('H:i'),
'is_attended' => $isAttended,
'can_attend' => $canAttend && ! $isAttended,
'status_label' => $statusLabel,
@ -167,19 +167,19 @@ public function table(Table $table): Table
return $table
->query(AttendanceResource::getEloquentQuery())
->modifyQueryUsing(fn(Builder $query) => $query->where('student_id', $user->student?->id))
->modifyQueryUsing(fn (Builder $query) => $query->where('student_id', $user->student?->id))
->columns([
TextColumn::make('student.full_name')
->label('Mahasiswa')
->sortable()
->searchable()
->visible(fn() => $user->hasRole([RoleEnum::Developer, RoleEnum::Kosma])),
->visible(fn () => $user->hasRole([RoleEnum::Developer, RoleEnum::Kosma])),
TextColumn::make('date')
->label('Tanggal')
->date('l, d F Y')
->sortable()
->description(fn(Attendance $record): string => $record->attended_at->format('H:i') . ' WIB')
->description(fn (Attendance $record): string => $record->attended_at->format('H:i').' WIB')
->color('gray'),
TextColumn::make('courseSchedule.course.name')
@ -187,7 +187,7 @@ public function table(Table $table): Table
->searchable()
->sortable()
->wrap()
->description(fn(Attendance $record): string => $record->courseSchedule->course->lecturer->full_name),
->description(fn (Attendance $record): string => $record->courseSchedule->course->lecturer->full_name),
])
->defaultSort('date', 'desc')
->filters([
@ -202,7 +202,7 @@ public function table(Table $table): Table
->query(function (Builder $query, array $data) {
return $query->when(
$data['value'],
fn(Builder $query) => $query->whereHas('courseSchedule', fn($q) => $q->where('course_id', $data['value']))
fn (Builder $query) => $query->whereHas('courseSchedule', fn ($q) => $q->where('course_id', $data['value']))
);
})
->searchable(),