<?php

namespace App\Models;

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

class ArmadaType extends Model
{
    use HasFactory;

    protected $table = 'm_armada_types';

    protected $fillable = [
        'name',
        'description',
        'delete_flag',
        'created_by',
        'updated_by',
        'created_at',
        'updated_at',
    ];

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

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

    public function ShipmentDeliverys()
    {
        return $this->hasMany(ShipmentDelivery::class, 'armada_type_id');
    }
}