<?php
namespace AppProviders;
use IlluminateSupportServiceProvider;
use IlluminateDatabaseEloquentFactoriesFactory;
use IlluminateSupportStr;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
//Add THIS
Factory::guessFactoryNamesUsing(function (string $model_name) {
$namespace = 'DatabaseFactories';
$model_name = Str::afterLast($model_name, '');
return $namespace . $model_name . 'Factory';
});
}
}