Esempio n. 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $module = $this->argument('module');
     $moduleName = studly_case($module);
     if (isset($module)) {
         if (!$this->module->exists($module)) {
             return $this->error("Module [{$moduleName}] does not exist.");
         }
         if ($this->module->isEnabled($module)) {
             $this->seed($module);
         } elseif ($this->option('force')) {
             $this->seed($module);
         }
         return;
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->seed($module['slug']);
         }
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->prepareDatabase();
     if (!empty($this->argument('slug'))) {
         $module = $this->module->where('slug', $this->argument('slug'))->first();
         if ($this->module->isEnabled($module['slug'])) {
             return $this->migrate($module['slug']);
         } elseif ($this->option('force')) {
             return $this->migrate($module['slug']);
         } else {
             return $this->error('Nothing to migrate.');
         }
     } else {
         return $this->migrate();
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return null;
     }
     $slug = $this->argument('slug');
     if (!empty($slug)) {
         if ($this->module->isEnabled($slug)) {
             return $this->reset($slug);
         } elseif ($this->option('force')) {
             return $this->reset($slug);
         }
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all()->reverse();
         } else {
             $modules = $this->module->enabled()->reverse();
         }
         foreach ($modules as $module) {
             $this->reset($module['slug']);
         }
     }
 }
Esempio n. 4
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->prepareDatabase();
     if (!empty($this->argument('slug'))) {
         $module = $this->module->getProperties($this->argument('slug'));
         if ($this->module->isEnabled($module['slug'])) {
             return $this->migrate($module['slug']);
         } elseif ($this->option('force')) {
             return $this->migrate($module['slug']);
         } else {
             return $this->error('Nothing to migrate.');
         }
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->migrate($module['slug']);
         }
     }
 }
Esempio n. 5
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return null;
     }
     $this->prepareDatabase();
     $module = $this->module->getProperties($this->argument('module'));
     if (!is_null($module)) {
         if ($this->module->isEnabled($module['slug'])) {
             return $this->migrate($module['slug']);
         } elseif ($this->option('force')) {
             return $this->migrate($module['slug']);
         }
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->migrate($module['slug']);
         }
     }
 }
Esempio n. 6
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $slug = $this->argument('slug');
     if (isset($slug)) {
         if (!$this->module->exists($slug)) {
             return $this->error('Module does not exist.');
         }
         if ($this->module->isEnabled($slug)) {
             $this->seed($slug);
         } elseif ($this->option('force')) {
             $this->seed($slug);
         }
         return;
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->seed($module['slug']);
         }
     }
 }
Esempio n. 7
0
 /**
  * Returns module manifest information.
  *
  * @param string  $module
  * @return array
  */
 protected function getModuleInformation($module)
 {
     return ['#' => $module['order'], 'name' => $module['name'], 'slug' => $module['slug'], 'description' => $module['description'], 'status' => $this->module->isEnabled($module['slug']) ? 'Enabled' : 'Disabled'];
 }