diff --git a/src/Module.php b/src/Module.php index 77a5cc9..f914fe1 100644 --- a/src/Module.php +++ b/src/Module.php @@ -229,8 +229,12 @@ private function registerMiddleware(): void */ private function registerFactories(): void { - // Unfortunately Laravel 8 no longer supports loading factories like this - // because they want you to use ModelFactories. + if ( + method_exists($this, 'loadFactoriesFrom') && + file_exists($this->getModulePath().'/Database/Factories') + ) { + $this->loadFactoriesFrom($this->getModulePath().'/Database/Factories'); + } } private function registerRoutes(): void