From a4e8ba60da294f47295701736dc6461f2f2bc040 Mon Sep 17 00:00:00 2001 From: Sebastian Popp Date: Thu, 13 Jun 2024 10:01:00 +0200 Subject: [PATCH] check if method isForceDeleting exists before calling it --- src/Versionable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Versionable.php b/src/Versionable.php index 58b0cfa..89e14fe 100644 --- a/src/Versionable.php +++ b/src/Versionable.php @@ -53,7 +53,7 @@ public static function bootVersionable(): void static::deleted( function (Model $model) { /* @var \Overtrue\LaravelVersionable\Versionable|\Overtrue\LaravelVersionable\Version$model */ - if ($model->isForceDeleting()) { + if (method_exists($model, 'isForceDeleting') && $model->isForceDeleting()) { $model->forceRemoveAllVersions(); } }