<?php
namespace Nwidart\Modules\Traits;
trait MigrationLoaderTrait
{
protected function loadMigrationFiles($module)
{
$path = $this->laravel['modules']->getModulePath($module) . $this->getMigrationGeneratorPath();
$files = $this->laravel['files']->glob($path . '/*_*.php');
foreach ($files as $file) {
$this->laravel['files']->requireOnce($file);
}
}
protected function getMigrationGeneratorPath()
{
return $this->laravel['modules']->config('paths.generator.migration');
}
}