<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Sampah extends Model
{
    protected $table = 'sampah';
    protected $primaryKey = 'id_sampah';

    protected $fillable = [
        'user_id',
        'tahun',
        'total_sampah',
        'total_kelola',
        'total_daur_ulang',
        'sisa_sampah',
    ];

    /**
     * Relasi ke tabel users
     * One Sampah belongs to one User
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}
