public function complemento() { return CfdiComplemento::whereRaw("cfdi_id = {$this->id}")->first(); }
public function xml() { $cfdi_id = $this->cfdi->id; if (CfdiComplemento::whereRaw("cfdi_id = {$cfdi_id}")->count() == 0) { return $this->xml->getXML(); } else { return file_get_contents($this->path . "/" . strtoupper($this->cfdi->uuid()) . ".xml"); } }