Skip to content

Commit

Permalink
Allow loading legacy database factories
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-bongers committed Apr 23, 2021
1 parent 6cb5df7 commit 975c6d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 975c6d8

Please sign in to comment.