Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
+ Add optional parameter on HasFactory trait class
Browse files Browse the repository at this point in the history
  • Loading branch information
ianriizky committed May 21, 2021
1 parent 6fc8393 commit bcecdf2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Illuminate/Database/Eloquent/Factories/HasFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ trait HasFactory
/**
* Get a new factory instance for the model.
*
* @param mixed ...$paramaters
* @return \Illuminate\Database\Eloquent\FactoryBuilder
*/
public static function factory(): FactoryBuilder
public static function factory(...$paramaters): FactoryBuilder
{
return factory(static::class);
$paramaters = array_merge([static::class], $paramaters);

return factory(...$paramaters);
}
}

0 comments on commit bcecdf2

Please sign in to comment.