/** * Restore the instance after serialization. * * @return void */ public function __wakeup() { $this->bag->unserialize(); $this->previousPipes = array_map(function ($pipeIdentifier) { return PipeFactory::makeFromPipeIdentifier($pipeIdentifier); }, $this->previousPipes); $this->nextPipe = PipeFactory::makeFromPipeIdentifier($this->nextPipe); $progressModelIdentifier = $this->progress; $this->progress = (new $progressModelIdentifier->class())->findOrFail($progressModelIdentifier->id); }
/** * Starts the pipeline with a model * * @param Model $model Model that will be used to get the correct pipe * @return void */ public function startWithModel(Model $model) { $initialPipe = PipeFactory::make($model); $this->startWith($initialPipe); }