Пример #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $fkCheck = $this->input->getOption('fkCheck');
     $fkCheck ? null : DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     $this->module = $this->laravel['modules'];
     $arguments = $this->input->getArguments();
     $name = array_key_exists('module', $arguments) && $arguments['module'] ? strtolower($arguments['module']) : null;
     if (!$name) {
         return parent::fire();
     }
     //parent::fire();
     if ($name) {
         return $this->dbseed($name);
     }
     foreach ($this->module->getOrdered($this->option('direction')) as $module) {
         $this->line('Seed for module: <info>' . $module->getName() . '</info>');
         $this->dbseed($module->getDotName());
     }
     $fkCheck ? null : DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     return $this->info('All modules seeded.');
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->resolver->setDefaultConnection($this->getDatabase());
     $this->getSeeder()->run();
 }
Пример #2
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $fkCheck = $this->input->getOption('fkCheck');
     $fkCheck ? null : DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     if (!is_null($path = $this->input->getOption('path'))) {
         return $this->migrate($path);
     }
     $this->migrate();
     $this->module = $this->laravel['modules'];
     $name = strtolower($this->argument('module') ?: '');
     if ($name) {
         return $this->migrate(null, $name);
     }
     foreach ($this->module->getOrdered($this->option('direction')) as $module) {
         $this->line('Running for module: <info>' . $module->getName() . '</info>');
         $this->migrate(null, $module->getDotName());
     }
     $fkCheck ? null : DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     return $this->info('All modules migrated.');
 }