<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class StikerTransDetail extends Model
{
    use HasFactory;

    protected $table = 'detail_transaksi_stiker';

    protected $fillable = [
        'notrans', 'nopol', 'jenis_mobil', 'adm', 'kategori', 
        'jenis_member', 'akses', 'akses_out', 'status', 'merk', 
        'tipe', 'tahun', 'warna', 'keterangan',
    ];

    public function stiker_details ()
    {
        return $this->belongsTo(StikerTrans::class, 'notrans', 'notrans');
    }

    // Relasi ke tabel jenis_mobil
    public function vehicle()
    {
        return $this->belongsTo(JenisMobil::class, 'id', 'jenis_mobil');
    }
}
