Esempio n. 1
0
 /**
  * Publish something.
  */
 public function publish()
 {
     $sourcePath = $this->getSourcePath();
     if (!$this->isDirectory($sourcePath)) {
         return;
     }
     if (!$this->isDirectory($destinationPath = $this->getDestinationPath())) {
         $this->makeDirectory($destinationPath, 0775, true);
     }
     if ($this->copyDirectory($sourcePath, $destinationPath) && $this->showMessage) {
         $this->console->line("<info>Published</info>: {$this->module->getStudlyName()}");
     } else {
         $this->console->error($this->error);
     }
 }
Esempio n. 2
0
 /**
  * Get migration path.
  *
  * @return string
  */
 public function getPath()
 {
     return $this->module->getExtraPath(config('modules.paths.generator.migration'));
 }
Esempio n. 3
0
 /**
  * Get class namespace.
  *
  * @param  Module  $module
  *
  * @return string
  */
 protected function getClassNamespace(Module $module)
 {
     $extra = str_replace($this->getClass(), '', $this->argument($this->argumentName));
     return rtrim(implode('\\', [config('workbench.namespace'), $module->getStudlyName(), $this->getDefaultNamespace(), str_replace('/', '\\', $extra)]), '\\');
 }
Esempio n. 4
0
 /**
  * Get migration path for specific module.
  *
  * @param  Module $module
  *
  * @return string
  */
 private function getPath(Module $module)
 {
     $path = $module->getExtraPath(config('modules.paths.generator.migration'));
     return str_replace(base_path(), '', $path);
 }