Example #1
0
 /**
  * Execute the console command.
  */
 public function handle()
 {
     $modules = $this->moduly->all();
     if ($modules->count()) {
         $this->displayModules($modules);
     } else {
         // @codeCoverageIgnoreStart
         $this->error("Your application doesn't have any modules.");
         // @codeCoverageIgnoreEnd
     }
 }
Example #2
0
 /**
  * Seed the specific module.
  *
  * @param  string  $module
  * @param  bool    $force
  */
 protected function seed($module, $force = false)
 {
     $params = [];
     $moduleName = studly_case($module);
     $namespace = $this->module->getNamespace();
     $fullPath = $namespace . $moduleName . '\\Seeds\\' . $moduleName . 'DatabaseSeeder';
     if (!class_exists($fullPath, false)) {
         return;
     }
     $params['--class'] = $this->getStringOption('class') ? $this->getStringOption('class') : $fullPath;
     if ($this->getStringOption('database')) {
         $params['--database'] = $this->getStringOption('database');
     }
     if ($force) {
         $params['--force'] = $force;
     }
     $this->call('db:seed', $params);
 }
Example #3
0
 /**
  * Get migrations path.
  *
  * @return string
  */
 protected function getMigrationPath($slug)
 {
     return $this->module->getModulePath($slug) . config('moduly.folders.migrations');
 }
 /**
  * Run the migration rollback for all modules.
  */
 private function rollbackAll()
 {
     foreach ($this->module->all() as $module) {
         $this->rollback($module->name);
     }
 }