From 6509ad872ec219ba56f4613f59589f76959fa638 Mon Sep 17 00:00:00 2001 From: netpok Date: Wed, 28 Apr 2021 20:20:41 +0200 Subject: [PATCH] Add fallback when migration is not anonymous class (#37166) --- src/Illuminate/Database/Migrations/Migrator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php index c204e1764314..31df31700c70 100755 --- a/src/Illuminate/Database/Migrations/Migrator.php +++ b/src/Illuminate/Database/Migrations/Migrator.php @@ -474,7 +474,9 @@ protected function resolvePath(string $path) return new $class; } - return $this->files->getRequire($path); + $migration = $this->files->getRequire($path); + + return is_object($migration) ? $migration : new $class; } /**