<?php

namespace App\Models;

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

class ArmazemModel extends Model
{
    use HasFactory;
    use SoftDeletes;
    protected $dates = ['deleted_at'];
    protected $table='armazens';
    protected $fillable = ['nomearmazem','base_id','usuario_id','numerocorredores','numeroandares','cor_tema', 'imagem_tema', 'alturam', 'alturacm', 'larguram', 'larguracm', 'profundidadem', 'profundidadecm', 'estado'];


    public function getBase(){

        return $this->belongsTo(BaseGestdoc::class,'base_id','id');
    }

    public function getOwner(){

        return $this->belongsTo(User::class, 'usuario_id','id');
    }
    public function getCorredores(){

        return $this->hasMany(Corredor::class);
    }
    
    public function getFileira(){
         return $this->belongsTo(Fileira::class,'fila_id','id');
    }
}
