<?php 

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Laporan extends Model
{
    use HasFactory;

    protected $table = 'reports'; // Nama tabel di database

    protected $primaryKey = 'id_laporan'; // Primary key tabel

    public $timestamps = true; // Aktifkan timestamps

    protected $fillable = [
        'tahun',
        'bulan',
        'total_pendapatan',
        'total_pengeluaran',
        'keuntungan_bersih',
    ];

    protected $casts = [
        'tahun' => 'integer',
        'bulan' => 'integer',
        'total_pendapatan' => 'decimal:2',
        'total_pengeluaran' => 'decimal:2',
        'keuntungan_bersih' => 'decimal:2',
    ];
}
