$user = User::find(1); // Retrieve the user record with id = 1 $user->delete(); // Delete the user record from the database
$entityManager = EntityManager::create($connectionParams, $config); $userRepository = $entityManager->getRepository(User::class); $user = $userRepository->find(1); // Retrieve the user record with id = 1 $entityManager->remove($user); // Delete the user record from the database $entityManager->flush(); // Persist the changes to the databaseIn these examples, the package library used for PHP Model delete is Laravel ORM and Doctrine ORM, respectively.