@extends('layouts.app') @section('title', 'New admission') @php($g = fn ($slot, $field) => old("guardians.$slot.$field")) @section('content') @if (session('duplicate'))
{{ session('duplicate') }}
@endif @if ($years->isEmpty() || $sections->isEmpty())
Admissions need an open academic year with sections. Set them up under Academic.
@endif
@csrf

1. Student details

@foreach ([['first_name', 'First name', true, 4], ['last_name', 'Last name', false, 4]] as [$f, $l, $req, $w])
@error($f)
{{ $message }}
@enderror
@endforeach
@error('date_of_birth')
{{ $message }}
@enderror
@error('aadhaar_no')
{{ $message }}
@enderror
@include('partials.custom-field-inputs', ['fields' => $customFields->where('form_step', 'student_details'), 'values' => []])

2. Guardians

@error('guardians')
{{ $message }}
@enderror @error('primary')
{{ $message }}
@enderror
@foreach (['father' => 'Father', 'mother' => 'Mother', 'other' => 'Other guardian'] as $slot => $label)
{{ $label }}
@if ($slot === 'other') @endif @error("guardians.$slot.name")
{{ $message }}
@enderror @error("guardians.$slot.phone")
{{ $message }}
@enderror
@endforeach @include('partials.custom-field-inputs', ['fields' => $customFields->where('form_step', 'guardians'), 'values' => []])

3. Admission and class

@include('partials.branch-field', ['branches' => $branches, 'selected' => $selectedBranch, 'class' => 'col-md-3'])
@error('section_id')
{{ $message }}
@enderror
@if ($admissionNoEditable) @error('admission_no')
{{ $message }}
@enderror @else @endif
@include('partials.custom-field-inputs', ['fields' => $customFields->where('form_step', 'admission'), 'values' => []])

4. Documents

@for ($i = 0; $i < 3; $i++)
@endfor
PDF, JPG or PNG, up to 2 MB each.

5. Logins

Login details are shown once after saving, with a WhatsApp link and a printable slip.
@endsection