diff --git a/src/Support/ServiceProvider.php b/src/Support/ServiceProvider.php index 2bac1b6f..082a89a2 100644 --- a/src/Support/ServiceProvider.php +++ b/src/Support/ServiceProvider.php @@ -5,6 +5,7 @@ use SplFileInfo; use Symfony\Component\Finder\Finder; use Illuminate\Support\ServiceProvider as IlluminateServiceProvider; +use Illuminate\Database\Eloquent\Factory; class ServiceProvider extends IlluminateServiceProvider { @@ -65,9 +66,7 @@ protected function loadConfigsFrom($path) */ protected function loadFactoriesFrom($path) { - foreach (glob($path.'/*.php') as $file) { - require $file; - } + app(Factory::class)->load($path); } /**