This is a loaded question! Start by fixing the isEdit logic using the NovaRequest to properly detect if you’re in update or detail mode:
isEdit
NovaRequest
update
detail
$isEdit = $request->isUpdateOrUpdateAttachedRequest() || $request->isResourceDetailRequest();