Skip to content

Commit 21be655

Browse files
committed
Add extra option to disable legacy loading which breaks the new factory format
1 parent 8993f68 commit 21be655

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/Module.php

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ abstract class Module extends ServiceProvider implements ModuleContract
3636

3737
protected ?string $modulePath = null;
3838

39+
protected bool $disableAutomaticFactoryLoading = false;
40+
3941
/**
4042
* Register the module.
4143
*
@@ -230,6 +232,7 @@ private function registerMiddleware(): void
230232
private function registerFactories(): void
231233
{
232234
if (
235+
$this->disableAutomaticFactoryLoading === false &&
233236
method_exists($this, 'loadFactoriesFrom') &&
234237
file_exists($this->getModulePath().'/Database/Factories')
235238
) {

0 commit comments

Comments
 (0)