<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Inventory extends Model
{
//    protected  $fillable = [
//        'store_id',
//        'product_id',
//        'old_stock',
//        'new_stock',
//        'total_stock',
//        'created_by',
//        'updated_by',
//        'status_id',
//        'created_at',
//        'updated_at',
//        'deleted_by',
//        'deleted_at'
//    ];

protected  $guarded = [];

    use SoftDeletes;


    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function store()
    {
        return $this->belongsTo(Store::class);
    }

    public function product()
    {
        return $this->hasMany(Product::class, 'id');
    }

    public function stock()
    {
        return $this->hasMany(Stock::class);
    }

    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */
    protected $dates = ['deleted_at'];

//
//    public function deplete_inventory()
//    {
//
//    }
//

}

