/** * Execute the console command. * * @return mixed */ public function fire() { $workflow = ucfirst($this->argument('name')); if (!$this->pipelines->exists($workflow)) { return $this->error("The workflow [{$workflow}] does not exist."); } $this->info($this->drawer->draw($workflow)); }
/** * Set the pipes of the given workflow. * * @author Andrea Marco Sartori * @param string $workflow * @return void */ protected function setPipesOfWorkflow($workflow) { $pipes = $this->pipelines->getPipesByPipeline($workflow); $this->pipes = array_map(function ($pipe) { $chunks = explode('\\', $pipe); return end($chunks); }, $pipes); $this->geometry->setPipes($this->pipes); }
/** * Dispatch the given workflow. * * @author Andrea Marco Sartori * @param string $workflow * @return mixed */ protected function dispatchWorkflow($workflow) { $job = $this->inflector->getJob(); $request = $this->resolveRequest(); $pipes = $this->pipelines->getPipesByPipeline($workflow); $parameters = $this->container->make('router')->current()->parameters(); return $this->dispatcher->pipeThrough($pipes)->dispatchFrom($job, $request, $parameters); }