/**
  * Execute the console command.
  */
 public function fire()
 {
     $moduleName = $this->argument('name');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $this->call('migrate', $this->getParameters($module));
 }
Example #2
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $name = $this->argument('name');
     $module = $this->moduleRepo->getByName($name);
     if (!$module) {
         return $this->error("The [{$name}] module does not exist.");
     }
     $params = $this->getParameters($module);
     $this->call('db:seed', $params);
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $moduleName = $this->argument('name');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $migrationName = $this->argument('migration');
     $generator = new ModuleMigrationGenerator($migrationName, $this->laravel, $module);
     $generator->generate();
     $this->info("The migration [{$migrationName}] has been created for module [{$moduleName}].");
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $moduleName = $this->argument('name');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $requestName = $this->argument('request');
     $generator = new ModuleRequestGenerator($requestName, $this->laravel, $module);
     $generator->generate();
     $this->info("The request [{$requestName}] has been generated for module [{$moduleName}].");
 }
Example #5
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $name = $this->argument('name');
     $module = $this->moduleRepo->getByName($name);
     if (!$module) {
         return $this->error("The [{$name}] module does not exist.");
     }
     if ($module->isEnabled()) {
         return $this->error("The [{$name}] module is already enabled.");
     }
     $module->enable();
     $this->info("The [{$name}] module has been enabled.");
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $moduleName = $this->argument('moduleName');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $commandName = $this->argument('commandName');
     $generator = new ModuleCommandGenerator($commandName, $this->laravel, $module);
     $generator->generate();
     $this->info("The command [{$commandName}] has been created for module [{$moduleName}].");
     $this->call('module:make-handler', ['type' => 'command', 'moduleName' => $moduleName, 'handlerName' => $commandName . 'Handler', 'handlingName' => $commandName]);
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $moduleName = $this->argument('name');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $migrationsPath = $module->getMigrationPath();
     $files = $this->laravel['files']->glob($migrationsPath . '*');
     foreach ($files as $file) {
         $this->laravel['files']->requireOnce($file);
     }
     $this->call('migrate:rollback', $this->getParameters($module));
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $handlerType = $this->argument('type');
     if ($handlerType != 'event' && $handlerType != 'command') {
         return $this->error("Invalid handler type: [{$handlerType}].");
     }
     $moduleName = $this->argument('moduleName');
     $module = $this->moduleRepo->getByName($moduleName);
     if (!$module) {
         return $this->error("Module [{$moduleName}] does not exist.");
     }
     $handlerName = $this->argument('handlerName');
     $handlingName = $this->argument('handlingName');
     $generator = new ModuleHandlerGenerator($handlerName, $handlingName, $handlerType, $this->laravel, $module);
     $generator->generate();
     $this->info("The handler [{$handlerName}] has been created for module [{$moduleName}].");
 }