code: protected function exportJob($job)
      {
          $stats = $this->getJobStats($job);
  
          $contents = $this->renderForExport($job, $stats);
  
          $filename = trim($this->path, '/').'/'.$this->buildJobFileName($job, $stats);
  
          if (file_exists($filename)) {
              throw new \RuntimeException('File already exists.');
          }
  
          if (! file_put_contents($filename, $contents)) {
              throw new \RuntimeException('Error saving the file.');
          }
      }
docs: Exports job to a file.
  
  @param $job