@extends('layouts.portal') @section('title', 'My batches') @section('subtitle', 'Every batch assigned to you, with learners, schedule and progress.') @section('actions') Attendance@endsection @section('content') @php $groups = $batches->groupBy(fn ($b) => in_array($b->status, ['Running', 'Open', 'Full', 'Upcoming'], true) ? 'Active' : 'Finished'); @endphp @if($batches->isEmpty())
@endif @foreach(['Active', 'Finished'] as $g) @continue(! $groups->has($g))

first) style="margin-top:0" @endif>{{ $g }} batches {{ $groups[$g]->count() }}

@foreach($groups[$g] as $b)
{{ $b->batch_code }}

{{ $b->course->title }}

@endforeach
@endforeach @endsection