Skip to content

Commit

Permalink
Merge pull request #181 from maguilar92/hotfix/old_factory_subpackage
Browse files Browse the repository at this point in the history
Check first laravel 8 factory
  • Loading branch information
shalvah authored Jan 25, 2021
2 parents 5b571f4 + 14313c3 commit d464f71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tools/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static function getBaseTypeFromArrayType(string $typeName)

public static function getModelFactory(string $modelName, array $states = [])
{
if (!function_exists('factory')) { // Laravel 8 type factory
if (method_exists($modelName, 'factory')) { // Laravel 8 type factory
$factory = call_user_func_array([$modelName, 'factory'], []);
if (count($states)) {
foreach ($states as $state) {
Expand Down

0 comments on commit d464f71

Please sign in to comment.