<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AduanTps extends Model
{
    protected $table = 'aduan_tps';
    protected $primaryKey = 'id_aduan';

    protected $fillable = [
        'lokasi_tps_id',
        'nama_pelapor',
        'alamat_pelapor',
        'no_pelapor',
        'isi_aduan',
        'tanggal_aduan',
        'bukti_foto',
        'tanggapan_admin',
        'tanggal_tanggapan'
    ];

    // RELASI KE LOKASI TPS
    public function lokasiTps()
    {
        return $this->belongsTo(
            LokasiTps::class, // model tujuan
            'lokasi_tps_id',  // foreign key di aduan_tps
            'id_tps'          // primary key di lokasi_tps
        );
    }
}
