示例#1
0
 protected function writeMigration($name, $isCreateTable)
 {
     $classPath = $this->getFilePath($name);
     $dataForView = $this->getDataForClassView($name, $isCreateTable);
     File::save($classPath, view($this->migrationClassView, $dataForView)->render(), 0664);
     //        $this->openFileInPhpStorm($classPath);
     $this->line("<info>Created Migration:</info> " . pathinfo($classPath, PATHINFO_FILENAME));
     $this->line("Migration File: {$classPath}");
     $sqlFilePath = $this->getFilePath($name, true);
     File::save($sqlFilePath, "-- sql\n", 0664);
     $this->openFileInPhpStorm($sqlFilePath);
     $this->line("Migration SQL File: {$sqlFilePath}");
     if (!$isCreateTable) {
         $rollbackSqlFilePath = $this->getFilePath($name, true, true);
         File::save($rollbackSqlFilePath, "-- rollback\n", 0664);
         $this->openFileInPhpStorm($rollbackSqlFilePath);
         $this->line("Migration Rollback SQL File: {$rollbackSqlFilePath}");
     }
     $this->openFileInPhpStorm($sqlFilePath);
 }
示例#2
0
 protected function createScaffoldConfig($dataForViews)
 {
     $scaffoldConfigFile = $dataForViews['files']['scaffold_config'];
     if (File::exist($scaffoldConfigFile)) {
         File::remove();
     }
     File::save($scaffoldConfigFile, view($this->scaffoldConfigView, $dataForViews)->render(), 0664);
     $this->openFileInPhpStorm($scaffoldConfigFile);
     $this->line("ScaffoldConfig class created ({$scaffoldConfigFile})");
 }