@php $isEdit = isset($info) && $info; // add: preselect the parent passed in the URL (accounts/add/{id}) like legacy; edit: the account's parent $selectedParent = old('parent_account_id', $isEdit ? $info->parent_account_id : ($parent_account ?? 0)); @endphp