/** * Get the full namespace name for a given class. * * @param string $name * @return string */ protected function getNamespace($name) { if ($this->module) { return $this->module->getNamespace() . '\\Database\\Seeders'; } return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\'); }
/** * Resolve a migration instance from a file. * * @param string $file * @return object */ public function resolve($file) { $file = implode('_', array_slice(explode('_', $file), 4)); $class = Str::studly($file); if ($this->module) { $class = $this->module->getNamespace() . '\\Database\\Migrations\\' . $class; } return new $class(); }