From c6a9556b96bf97ca9833a58e73ae6c204f18ccbc Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 2 May 2022 13:08:40 +0430 Subject: [PATCH] fix: take namespace into account while cheking for factory class existance. --- Traits/FactoryLocatorTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Traits/FactoryLocatorTrait.php b/Traits/FactoryLocatorTrait.php index 02e0f6593..9c542ef0c 100644 --- a/Traits/FactoryLocatorTrait.php +++ b/Traits/FactoryLocatorTrait.php @@ -17,8 +17,8 @@ protected static function newFactory(): ?Factory Factory::useNamespace($nameSpace); $className = class_basename(static::class); - - if (!class_exists($className)) { + + if (!class_exists($nameSpace . $className . 'Factory')) { return null; }