From 4ac6c3d47f1488cf88431fabc9a5b1b468a7a963 Mon Sep 17 00:00:00 2001 From: Zlatoslav Desyatnikov Date: Wed, 11 Oct 2023 20:53:14 +0300 Subject: [PATCH] Fix model:prune error with non-class php files --- src/Illuminate/Database/Console/PruneCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Console/PruneCommand.php b/src/Illuminate/Database/Console/PruneCommand.php index 5144247eeff0..0c51beb345b2 100644 --- a/src/Illuminate/Database/Console/PruneCommand.php +++ b/src/Illuminate/Database/Console/PruneCommand.php @@ -138,10 +138,10 @@ protected function models() return $models->reject(function ($model) use ($except) { return in_array($model, $except); }); - })->filter(function ($model) { - return $this->isPrunable($model); })->filter(function ($model) { return class_exists($model); + })->filter(function ($model) { + return $this->isPrunable($model); })->values(); }