/** * @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); }
/** * @param $command * @return mixed */ public function execute($command) { $handler = $this->commandTranslator->toCommandHandler($command); return $this->app->make($handler)->handle($command); }