瀏覽代碼

Merge pull request #181 from maguilar92/hotfix/old_factory_subpackage

Check first laravel 8 factory
Shalvah 4 年之前
父節點
當前提交
d464f71b11
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Tools/Utils.php

+ 1 - 1
src/Tools/Utils.php

@@ -145,7 +145,7 @@ class Utils
 
     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) {