예제 #1
0
 /**
  * Get all modules.
  *
  * @return array
  */
 protected function getModules()
 {
     $modules = $this->module->all();
     $results = [];
     foreach ($modules as $module) {
         $results[] = $this->getModuleInformation($module);
     }
     return array_filter($results);
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     // SR [2016-05-06] Don't need the confirmation and
     // it does not work when called from controller with Artisan::call().
     //        	if (! $this->confirmToProceed()) return null;
     $slug = $this->argument('slug');
     if ($slug) {
         return $this->rollback($slug);
     } else {
         foreach ($this->module->all() as $module) {
             $this->rollback($module['slug']);
         }
     }
 }
 /**
  * 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']);
         }
     }
 }
 /**
  * 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 {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->migrate($module['slug']);
         }
     }
 }
예제 #5
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']);
         }
     }
 }