<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Barang extends Model
{
    protected $table = 'barangs';

    protected $fillable = [
        'nama',
        'kategori',
        'merk',
        'ukuran_spesifikasi',
        'satuan',
        'harga',
        'stok'
    ];

    // ✅ Relasi ke DetailTransaksi
    public function details()
    {
        return $this->hasMany(DetailTransaksi::class, 'barang_id');
    }
}