/** * Display specified contract * * @return Response */ public function show($id) { $contract = $this->contract->findWithAnnotations($id); if (!$contract) { abort('404'); } $translatedFrom = []; if (isset($contract->metadata->translated_from) && !empty($contract->metadata->translated_from)) { $translatedFrom = $this->contract->getcontracts($contract->metadata->translated_from); } $supportingDocument = $this->contract->getSupportingDocuments($contract->id); $status = $this->contract->getStatus($id); $annotationStatus = $this->annotation->getStatus($id); $annotations = $contract->annotations; $contract->metadata_comment = $this->comment->getLatest($contract->id, Comment::TYPE_METADATA); $contract->text_comment = $this->comment->getLatest($contract->id, Comment::TYPE_TEXT); $contract->annotation_comment = $this->comment->getLatest($contract->id, Comment::TYPE_ANNOTATION); return view('contract.show', compact('contract', 'status', 'annotations', 'annotationStatus', 'translatedFrom', 'supportingDocument')); }
/** * Display a listing of the Comment. * * @param $contract_id * @param ContractService $contract * @return Response */ public function index($contract_id, ContractService $contract) { $contract = $contract->find($contract_id); $comments = $this->comment->getPaginate($contract_id); return view('contract.comment.index', compact('contract', 'comments')); }