Skip to content

Commit

Permalink
Merge pull request #6 from zonneplan/feature/load-legacy-database-fac…
Browse files Browse the repository at this point in the history
…tories

Allow loading legacy database factories
  • Loading branch information
nijholt authored Apr 28, 2021
2 parents 6cb5df7 + 975c6d8 commit f3533e7
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 f3533e7

Please sign in to comment.