<?php

namespace App\Models\StockManagement;

use App\Models\StockManagement\Traits\HasStocks;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Output extends Model{
    use HasFactory,HasStocks;

    protected $table = "stock_mgt__outputs";
    protected $guarded = ['id'];
    public $timestamps = false;

    const MORPH_ID_COLUMN = "outputable_id";
    const MORPH_TYPE_COLUMN = "outputable_type";
    const MORPH_FUNCTION_NAME = "outputable";

    const FK_ID = "output_id";

    public function outputable(){
        return $this->morphTo(__FUNCTION__,
            self::MORPH_TYPE_COLUMN,self::MORPH_ID_COLUMN);
    }
}
