<?php
namespace App\Models\Inventory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Inventory extends Model
{
    const CREATED_AT = null;
    protected $table = 'inventories';
    protected $fillable = ['warehouse_id','material_id','quantity','batch_no','expire_date'];
    protected function casts(): array { return ['quantity'=>'decimal:2','expire_date'=>'date']; }
    public function warehouse(): BelongsTo { return $this->belongsTo(Warehouse::class); }
    public function material(): BelongsTo { return $this->belongsTo(Material::class); }
}
