@extends('layouts.admin') @section('title', 'Batches') @section('heading', 'Internship Batches') @section('subheading', 'Main and repeat internship intakes. Each batch runs for one year with four quarterly evaluation cycles.') @section('actions') New batch @endsection @use('App\Models\InternshipBatch', 'Batch') @section('content') @php $statusChip = [ 'upcoming' => ['Upcoming', 'bg-blue-50 text-blue-700 ring-blue-200'], 'in_progress' => ['In progress', 'bg-emerald-50 text-emerald-700 ring-emerald-200'], 'completed' => ['Completed', 'bg-slate-100 text-slate-600 ring-slate-200'], 'inactive' => ['Inactive', 'bg-slate-100 text-slate-500 ring-slate-200'], ]; @endphp
@include('admin.partials.toolbar', ['placeholder' => 'Search by title or code…', 'noun' => 'batches', 'items' => $items, 'filters' => [ 'year' => ['' => 'All years'] + $years->mapWithKeys(fn ($y) => [$y => $y])->all(), 'type' => ['' => 'Main & repeat'] + Batch::TYPES, ]])
@if($items->isEmpty())

{{ request()->hasAny(['q', 'year', 'type']) ? 'No batches match your filters' : 'No internship batches yet' }}

Create a batch to set the internship start date. The completion date and evaluation cycles are generated automatically.

Create first batch
@else
@foreach($items as $b) @php [$label, $chip] = $statusChip[$b->status()]; @endphp $b->type === 'main', 'bg-warm-gradient' => $b->type === 'repeat'])>
$b->type === 'main', 'bg-orange-500 text-white' => $b->type === 'repeat'])> {{ substr((string) $b->year, 0, 2) }}{{ substr((string) $b->year, 2) }}

{{ $b->typeLabel() }} batch · {{ $b->year }}

{{ $b->name }}

{{ $label }}
@if($b->description)

{{ $b->description }}

@endif
Starts
{{ $b->starts_on->format('j M Y') }}
Completes
{{ $b->ends_on->format('j M Y') }}
{{ $b->interns_count }} interns{{ $b->progressPercent() }}%

{{ $b->code }}

@endforeach
@if($items->hasPages())
@include('admin.partials.pagination', ['items' => $items])
@endif @endif @endsection