Skip to content

Commit aa1128c

Browse files
authored
Fix creation of a Factory via attribute so that configure method is called (#55190)
1 parent fff733f commit aa1128c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Factories/HasFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected static function getUseFactoryAttribute()
5252
if ($attributes !== []) {
5353
$useFactory = $attributes[0]->newInstance();
5454

55-
$factory = new $useFactory->factoryClass;
55+
$factory = $useFactory->factoryClass::new();
5656

5757
$factory->guessModelNamesUsing(fn () => static::class);
5858

0 commit comments

Comments
 (0)