コード例 #1
0
 /**
  * @param $command
  * @return mixed
  */
 public function execute($command)
 {
     $validator = $this->commandTranslator->toCommandValidator($command);
     if (class_exists($validator)) {
         $this->app->make($validator)->validate($command);
     }
     return $this->commandBus->execute($command);
 }
コード例 #2
0
 /**
  * @param $command
  * @return mixed
  */
 public function execute($command)
 {
     $handler = $this->commandTranslator->toCommandHandler($command);
     return $this->app->make($handler)->handle($command);
 }