/** * Append a collection to this collection. * * @param Collection $collection * * @return $this */ public function addCollection(Collection $collection) { // If there are jobs, add them to the collection if ($collection->count()) { foreach ($collection->all() as $job) { $this->add($job); } } // If there are errors, add them to the collection if ($collection->getErrors()) { foreach ($collection->getErrors() as $error) { $this->addError($error); } } return $this; }