I found a simple solution. At first, the object will be softdeletes, but if it has already been deleted, it will be deleted, so my simple solution:
$entity->setDeletedAt(new DateTime()); $entityManager->remove($entity); $entityManager->flush();
Of course, you need to turn off the softdelete filter first, and deletedAt the sofdelete field.
Vladatos
source share