<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Sanctum\HasApiTokens;

class DetailTransaksiPembelianModel extends Model
{
    use HasFactory;
    use HasApiTokens;
    public $timestamps = false;
    protected $table = "tb_detail_transaksi_pembelian";

      protected $fillable = [
        'id_transaksi', 'id_barang', 'harga', 'diskon', 'status', 'qty','created_at','id','id_transaksi_mobile','nama_barang','id_sub_transaksi'
      ];


    public function produk()
    {
        return $this->belongsTo(ProdukModel::class, 'id_barang','kode');
    }
}
