@php use Illuminate\Support\Facades\DB; $data = $data ?? null; $info = $data->applicant_information ?? null; $old_ninfo = isset($data->nominee_information)?$data->nominee_information:null; if($info) { $ninfo = DB::table('customer_nominee_informations') ->where('customer_id', $info->id) ->whereNull('joint_id') // joint_id null হবে ->get(); } else { $ninfo = collect(); // খালি collection } @endphp
@csrf {{-- ======================== Applicant Info ======================== --}}
Applicant Information
{{-- Example field row --}}
@if($errors->has('customer_code')) {{ $errors->first('customer_code') }} @endif
{{-- --}}
{{--
--}}
@if($errors->has('mobile_no')) {{ $errors->first('mobile_no') }} @endif
{!! uploadedFile(isset($info)?$info:'',isset($info)?$info->profile_photo:'','create','','profile_photo') !!} {{-- --}}
Address
@if($errors->has('present_address')) {{ $errors->first('present_address') }} @endif
@if($errors->has('permanent_address')) {{ $errors->first('permanent_address') }} @endif
{{-- ... (keep your other applicant fields exactly as before) ... --}} {{-- ======================== Nominee Section ======================== --}}
Nominee Information
@if ($ninfo->count() > 0) @foreach ($ninfo as $key => $ninfo) {{-- First Nominee --}}
@if(!$loop->first)
Nominee Information {{ $loop->iteration }}
@endif
{{-- Present Address --}}
{{-- Permanent Address --}}
@endforeach @else
{{-- Present Address --}}
{{-- Permanent Address --}}
@endif
{{-- Hidden template --}} {{-- ======================== Submit ======================== --}}