/**
  * 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;
     }
     return parent::getMigrationPath();
 }
Exemple #2
0
 protected function getFilePath($name, $forSqlFile = false, $forRollbackSqlFile = false)
 {
     $basePath = preg_replace('%[/\\\\]%', DIRECTORY_SEPARATOR, parent::getMigrationPath()) . DIRECTORY_SEPARATOR;
     if ($forSqlFile) {
         $basePath .= $this->sqlSubdir . DIRECTORY_SEPARATOR;
         if ($forRollbackSqlFile) {
             $basePath .= $this->sqlRollbackSubdir . DIRECTORY_SEPARATOR;
         }
     }
     if (!Folder::exist($basePath)) {
         Folder::add($basePath, 0775);
     }
     return $basePath . date('Y_m_d_His') . '_' . $name . ($forSqlFile ? '.sql' : '.php');
 }