<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SubAccount2 extends Model
{
    protected $table = 'sub_accounts_2';

    protected $fillable = ['parent_id', 'account_code', 'sub_name'];

    public function mainAccount(): BelongsTo
    {
        return $this->belongsTo(MainAccount::class, 'parent_id');
    }
}
