<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ReciboFactura extends Model
{
    use HasFactory;

    protected $table = 'recibo_factura';
    protected $primaryKey = 'id';  // importante: tu tabla tiene campo 'id'
    public $timestamps = true;     // tu SQL incluye created_at y updated_at

    protected $fillable = [
        'id_recibo',
        'id_factura',
    ];

    public function recibo()
    {
        return $this->belongsTo(Recibo::class, 'id_recibo', 'id_recibo');
    }

    public function factura()
    {
        return $this->belongsTo(Facturacion::class, 'id_factura', 'id_factura');
    }
}
