@php use App\Enums\Leads\FlagType; use App\Enums\Leads\SourceType; use App\Enums\Leads\TypeOfContact; $selectedPlanTypeId = old('plan_type_id', $lead->plan_type_id); $selectedPlanType = $getPricingPlanType->firstWhere('id', $selectedPlanTypeId); $selectedParentId = old('parent_id', optional($selectedPlanType)->name === 'B2B' ? $lead->parent_id : null); $selectedFamilyParentId = old('family_parent_id', optional($selectedPlanType)->name === 'Family' ? $lead->parent_id : null); $dateOfBirth = $lead->date_of_birth ? \Illuminate\Support\Carbon::parse($lead->date_of_birth)->format('Y-m-d') : null; @endphp