<?php

namespace Daniv04\HaciendaPackage\Models;


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


class ReceiptPayload extends Model
{

    use HasFactory;

     /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'receipts_payloads';

    protected $fillable = [
        'receipt_type',
        'receipt_id',
        'payload_json',
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'payload_json' => 'array',
    ];

    public function receipt()
    {
        return $this->belongsTo(Receipt::class, 'receipt_id');
    }



    
}