<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SpendingLog extends Model
{
    protected $fillable = [
        'client_id', 'spend_date', 'amount', 'note'
    ];

    protected $casts = [
        'spend_date' => 'date',
        'amount' => 'decimal:2'
    ];

    public function client()
    {
        return $this->belongsTo(Client::class, 'client_id', 'client_id');
    }
}
