faa; $now = Carbon::now(); $data = [ 'faa' => [ 'numero' => $faa->numero, 'unidade' => [ 'nome' => $faa->createdCentroCusto->infraestrutura->unidade->nome_fantasia ] ], 'paciente' => [ 'nome' => $faa->paciente->cidadao->nome, 'cns' => $faa->paciente->cidadao->cns ? MaskUtil::getCnsMasked($faa->paciente->cidadao->cns) : '', ], 'dataHora' => $now->format('H') . ' horas e ' . $now->format('i') . ' minutos' ]; return Template::make(self::TITLE, self::TEMPLATE)->withData($data)->getHtml(); } public function __invoke($atendimentoId) { return (new Pdf)->stream(self::getTemplate($atendimentoId), self::TITLE); } }