<?php

namespace App\Models;

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

class CostBook extends Model
{
    use HasFactory;

    public static function newCost($request)
    {
        $cost = new CostBook();
        $cost->date = date('Y-m-d');
        $cost->ledger_id = $request->ledger_id;
        $cost->detail = $request->detail ?? ' ';
        $cost->dr = $request->dr;
        $cost->save();
    }
}
