<?php

namespace App\Models;

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

class ProductBundle extends Model
{
    use HasFactory;

    protected $table = 'product_bundles';

    protected $fillable = [
        'bundle_product_id',
        'product_id',
        'multi_unit_id',
        'qty',
        'price',
    ];

    public function bundle()
    {
        return $this->belongsTo(Product::class, 'bundle_product_id');
    }

    public function product()
    {
        return $this->belongsTo(Product::class, 'product_id');
    }

    public function multiUnit()
    {
        return $this->belongsTo(MultiUnit::class, 'multi_unit_id');
    }
}
