/** * Execute the console command. * * @return mixed */ public function fire() { $this->info('processing contract document'); $contractId = $this->input->getArgument('contract_id'); try { $contract = $this->contract->find($contractId); if ($this->input->getOption('force')) { $this->contract->moveS3File(sprintf('%s/%s', $contract->id, $contract->file), $contract->file); $contract->pages()->delete(); $contract->pdf_process_status = Contract::PROCESSING_PIPELINE; $contract->save(); } if ($this->process->execute($contractId)) { $this->info('processing completed.'); } else { $this->error('Error processing contract document.check log for detail'); } } catch (ModelNotFoundException $exception) { $this->error('could cot find contract.' . $exception->getMessage()); } catch (\Exception $exception) { $this->error('processing contract document.' . $exception->getMessage()); } }
/** * @param $job * @param $data */ public function fire($job, $data) { $this->process->execute($data['contract_id']); $job->delete(); }