belongsTo(Invoice::class); } public function rfc(): BelongsTo { return $this->belongsTo(Rfc::class); } public function invoiceType(): BelongsTo { return $this->belongsTo(InvoiceType::class); } public function paymentType(): BelongsTo { return $this->belongsTo(PaymentType::class); } public function issuerRfc(): BelongsTo { return $this->belongsTo(Rfc::class); } public function receiverRfc(): BelongsTo { return $this->belongsTo(Rfc::class); } public function getIssuerRfcAttribute() { return $this->issuerRfc()->first()->rfc; } public function getReceiverRfcAttribute() { return $this->receiverRfc()->first()->rfc; } protected $keyType = 'string'; protected $hidden = ['issuer_rfc_id', 'receiver_rfc_id']; protected $appends = ['issuer_rfc', 'receiver_rfc']; }