Пример #1
0
 /**
  * Run the migration from the specified module.
  *
  * @param string $name
  *
  * @return mixed
  */
 protected function migrate($name)
 {
     $module = $this->module->findOrFail($name);
     $this->call('migrate', ['--path' => $this->getPath($module), '--database' => $this->option('database'), '--pretend' => $this->option('pretend'), '--force' => $this->option('force')]);
     if ($this->option('seed')) {
         $this->call('module:seed', ['module' => $name]);
     }
 }
Пример #2
0
 /**
  * Run the migration from the specified module.
  *
  * @param string $name
  *
  * @return mixed
  */
 protected function migrate($name)
 {
     $module = $this->module->findOrFail($name);
     $migrator = new Migrator($module);
     $migrated = $migrator->migrate();
     if (count($migrated)) {
         foreach ($migrated as $migration) {
             $this->line("Migrated: <info>{$migration}</info>");
         }
         return;
     }
     $this->comment('Nothing to migrate.');
     if ($this->option('seed')) {
         $this->call('module:seed', ['module' => $name]);
     }
 }
Пример #3
0
 /**
  * Find a specific module, if there return that, otherwise throw exception.
  *
  * @param $name
  * @return \Pingpong\Modules\Module 
  * @throws ModuleNotFoundException
  * @static 
  */
 public static function findOrFail($name)
 {
     return \Pingpong\Modules\Repository::findOrFail($name);
 }
Пример #4
0
 public function destroy($name)
 {
     $module = $this->modules->findOrFail($name);
     $module->delete();
     return redirect()->back();
 }