예제 #1
0
 /**
  * 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)), '\\');
 }
예제 #2
0
 /**
  * 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();
 }
예제 #3
0
 /**
  * Get migration path (either specified by '--path' option or default location).
  *
  * @return string
  */
 protected function getMigrationPath()
 {
     if (!is_null($targetPath = $this->input->getOption('path'))) {
         return $this->laravel->basePath() . '/' . $targetPath;
     }
     if ($this->module) {
         return $this->module->getExtraPath('Database/Migrations');
     }
     return parent::getMigrationPath();
 }