@extends('themes.six.master') @section('title', 'Online Admission') @section('content') @php $root = $data['data'] ?? $data; $title = $root['title'] ?? 'Online Admission Form'; $genderList = $root['genderList'] ?? []; $classList = $root['classList'] ?? []; $bloodgroup = $root['bloodgroup'] ?? []; $flags = $root['field_list'] ?? []; $isRequired = fn($k) => isset($flags[$k]) && $flags[$k] == '1'; $isPresent = fn($k) => array_key_exists($k, $flags); // Smart type detection $detectType = function ($key) { $key = strtolower($key); return match (true) { str_contains($key, 'date') => 'date', str_contains($key, 'dob') => 'date', str_contains($key, 'email') => 'email', str_contains($key, 'photo') || str_contains($key, 'pic') || str_contains($key, 'document') => 'file', str_contains($key, 'address') || str_contains($key, 'details') || str_contains($key, 'note') => 'textarea', str_contains($key, 'height') || str_contains($key, 'weight') => 'number', default => 'text', }; }; $sections = [ 'Student Information' => [ 'firstname','middlename','lastname','dob','class_id','gender','category','religion','cast', 'mobile_no','admission_date','is_blood_group','student_height','student_weight','student_email','Number' ], 'Parents / Guardian' => [ 'father_name','father_phone','father_occupation','mother_name','mother_phone','mother_occupation', 'guardian_name','guardian_relation','guardian_phone','guardian_email','guardian_occupation' ], 'Addresses' => ['current_address','permanent_address','guardian_address'], 'Additional Details' => [ 'bank_account_no','bank_name','ifsc_code','national_identification_no','local_identification_no', 'previous_school_details','student_note' ], 'Documents & Photos' => [ 'student_photo','document','father_pic','mother_pic','guardian_photo' ], ]; $knownKeys = collect($sections)->flatten()->toArray(); $prettyLabel = fn($k) => ucwords(str_replace('_', ' ', preg_replace('/^(is_)/', '', $k))); @endphp
Fields marked with * are required as per upstream configuration.