<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Dispatch extends Model
{
    protected $fillable = [
        'dispatch_no',
        'sales_user_id',
        'dispatch_date',
        'remarks',
        'status',
        'created_by',
        'updated_by'
    ];

    public function salesUser()
    {
        return $this->belongsTo(User::class, 'sales_user_id');
    }

    public function items()
    {
        return $this->hasMany(DispatchItem::class);
    }

    public function creator()
    {
        return $this->belongsTo(User::class, 'created_by');
    }


    
}
