<?php

namespace App\Models;

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

class ExpenseCategory extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'name_bn',
        'description',
        'is_active'
    ];

    public function expenses()
    {
        return $this->hasMany(Expense::class);
    }

    // Accessor for Bengali name
    public function getNameInBanglaAttribute()
    {
        return $this->name_bn ?? $this->name;
    }
}