@php use App\Support\Money; $tenant = \App\Support\Facades\Tenancy::get(); $brandStyle = $tenant->brand_primary_color ? ":root { --color-brand-600: {$tenant->brand_primary_color}; } .dark { --color-brand-600: {$tenant->brand_primary_color}; }" : null; $statusColors = ['upcoming' => 'amber', 'running' => 'green', 'completed' => 'slate', 'cancelled' => 'red', 'active' => 'green', 'dropped' => 'red', 'transferred' => 'slate']; $showFees = $tenant->hasModule('batch_fees'); $showAttendance = $tenant->hasModule('batch_attendance'); $active = $enrollments->where('status', 'active'); $totalDue = $active->sum(fn ($e) => $e->dueCents()); $open = in_array($batch->status, ['upcoming', 'running'], true); @endphp
@if($showAttendance) Take Attendance @endif @if($enrollments->isEmpty()) @endif @include('tenant.coaching._errors')

Status

{{ ucfirst($batch->status) }}

{{ $batch->start_date->format('d M Y') }} → {{ $batch->end_date?->format('d M Y') ?? 'open-ended' }}

Schedule

{{ $batch->daysLabel() }}

{{ $batch->timeLabel() }}

Instructor & place

{{ $batch->teacher ? $batch->teacher->first_name.' '.$batch->teacher->last_name : 'Not assigned' }}

{{ $batch->mode === 'online' ? 'Online' : ($batch->room?->name ?? 'No room') }}{{ $batch->mode === 'hybrid' ? ' + online' : '' }} @if($batch->online_link) · class link @endif

Seats

{{ $active->count() }}{{ $batch->capacity ? ' / '.$batch->capacity : '' }}

{{ Money::format($batch->effectiveFeeCents(), $currency) }}{{ $batch->course->billing_type === 'monthly' ? ' / month' : '' }} @if($showFees && $totalDue) · {{ Money::format($totalDue, $currency) }} due@endif

@if($open)
New student (Quick Admission)
@if(strlen($search) >= 2)
@forelse($candidates as $candidate)
@csrf

{{ $candidate->first_name }} {{ $candidate->last_name }}

{{ $candidate->student_code }}{{ $candidate->emergency_contact_phone ? ' · '.$candidate->emergency_contact_phone : '' }}

@if($showFees) @endif
@empty

No matching students who aren't already in this batch.

@endforelse
@endif
@endif

Students

@if($showFees)@endif @if($showAttendance)@endif @forelse($enrollments as $enrollment) @php $student = $enrollment->student; $guardian = $student->guardians->firstWhere('pivot.is_primary', true) ?? $student->guardians->first(); $stats = $attendance->get($student->id); $due = $enrollment->dueCents(); @endphp @if($showFees) @endif @if($showAttendance) @endif @empty @endforelse
# Student Guardian EnrolledFeeDueAttendanceStatus
{{ $loop->iteration }} {{ $student->first_name }} {{ $student->last_name }}

{{ $student->student_code }}

{{ $guardian ? $guardian->first_name.' ('.$guardian->relationship.')' : '—' }}

{{ $guardian?->phone ?? $student->emergency_contact_phone }}

{{ $enrollment->enrolled_on->format('d M Y') }} {{ Money::format($enrollment->netFeeCents(), $currency) }} @if($enrollment->discount_cents)

−{{ Money::format($enrollment->discount_cents, $currency) }} discount

@endif
{{ $due ? Money::format($due, $currency) : 'Paid up' }}{{ $stats && $stats->total ? round($stats->attended / $stats->total * 100).'%' : '—' }}{{ $stats ? ' of '.$stats->total : '' }} {{ ucfirst($enrollment->status) }} @if($enrollment->status === 'transferred' && $enrollment->transferredTo)

→ {{ $enrollment->transferredTo->batch?->name }}

@endif
@if($enrollment->status === 'active')
@if($tenant->hasModule('batch_tests')) Progress @endif
@csrf

{{ $student->first_name }} keeps the same fee terms; any unpaid fees move with them.

@endif
No students yet. Search above or use Quick Admission.
@include('tenant.coaching.batches._form', ['batch' => $batch]) @if($enrollments->isEmpty()) @endif