Unverified Commit a475153c authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #643 from xfudox/pull_requests/load_factories

edited module-service-provider.stub to load module's factories
parents a4f99860 28ac124f
......@@ -2,6 +2,7 @@
namespace Modules\$MODULE$\Providers;
use Illuminate\Database\Eloquent\Factory as EloquentFactory;
use Illuminate\Support\ServiceProvider;
use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Core\Events\BuildingSidebar;
......@@ -31,6 +32,8 @@ class $MODULE$ServiceProvider extends ServiceProvider
$this->app['events']->listen(LoadingBackendTranslations::class, function (LoadingBackendTranslations $event) {
// append translations
});
$this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/factories');
}
public function boot()
......@@ -54,4 +57,15 @@ class $MODULE$ServiceProvider extends ServiceProvider
{
// add bindings
}
/**
* Register factories.
*
* @param string $path
* @return void
*/
protected function registerEloquentFactoriesFrom($path)
{
$this->app->make(EloquentFactory::class)->load($path);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment