/** * 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); } }
/** * Get migration path. * * @return string */ public function getPath() { return $this->module->getExtraPath(config('modules.paths.generator.migration')); }
/** * 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)]), '\\'); }
/** * 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); }