Skip to content

Commit f3533e7

Browse files
authored
Merge pull request #6 from zonneplan/feature/load-legacy-database-factories
Allow loading legacy database factories
2 parents 6cb5df7 + 975c6d8 commit f3533e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Module.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,12 @@ private function registerMiddleware(): void
229229
*/
230230
private function registerFactories(): void
231231
{
232-
// Unfortunately Laravel 8 no longer supports loading factories like this
233-
// because they want you to use ModelFactories.
232+
if (
233+
method_exists($this, 'loadFactoriesFrom') &&
234+
file_exists($this->getModulePath().'/Database/Factories')
235+
) {
236+
$this->loadFactoriesFrom($this->getModulePath().'/Database/Factories');
237+
}
234238
}
235239

236240
private function registerRoutes(): void

0 commit comments

Comments
 (0)