]> _ Git - cubist_cms-back.git/commitdiff
wait #6716 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Feb 2024 18:08:10 +0000 (19:08 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Feb 2024 18:08:10 +0000 (19:08 +0100)
src/app/Magic/Traits/CustomDataSource.php

index 6f6a13bfef8b35f62e38c93e646ead6cb81053c9..0a1ea90697d7fa4907b90969d5bb8e28391c7ac7 100644 (file)
@@ -42,6 +42,10 @@ trait CustomDataSource
 
         $instance = (new static);
 
+        if (method_exists($instance, 'forceDelete')) {
+            static::withoutGlobalScopes()->onlyTrashed()->forceDelete();
+        }
+
         $listAllInDb = static::withoutGlobalScopes()->get();
         $pk = $instance->getPrimaryKey();
         $existingKeys = [];