<?php

namespace App\Models;

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

class MonyImport extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $guarded = [];

    protected $fillable = [
        'mony_type_id',
        'customer_id',
        'supplier_id',
        'date',
        'value',
        'notes',
        'land_id',
        'user_id',
        'equip_id',
    ];

    public function monyType()
    {
        return $this->belongsTo(MonyType::class);
    }

    public function customer()
    {
        return $this->belongsTo(Customer::class);
    }

    public function supplier()
    {
        return $this->belongsTo(Supplier::class);
    }

    public function lands()
    {
        return $this->belongsToMany(Land::class);
    }

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